-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js
26 lines (23 loc) · 658 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const ShopifyTheme = require('./lib/theme.js')
const util = require('./lib/util.js')
const shopifyThemeInstances = [];
/*
var theme = shopifytheme.create();
gulp.src().pipe(theme.stream());
theme.init(options);
*/
function make (options) {
var shopifyTheme;
var previous = shopifyThemeInstances.filter((instance)=>{
return options.shop_name === instance._shopName && options.api_key === instance._apiKey;
});
if (previous.length) return previous[0];
shopifyTheme = new ShopifyTheme( options );
shopifyThemeInstances.push(shopifyTheme);
return shopifyTheme;
}
module.exports = {
create: make,
make,
util,
};