UNPKG

gulp-shopify-upload-by-bitcode

Version:

A tool to watch and upload files to Shopify for use in theme editing

64 lines (50 loc) 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getListFile = undefined; var _fs3 = require("fs"); var _fs4 = _interopRequireDefault2(_fs3); var _pathCompleteExtname = require("path-complete-extname"); var _pathCompleteExtname2 = _interopRequireDefault2(_pathCompleteExtname); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.defineProperty(exports, "__esModule", { value: true }); var _fs2 = _interopRequireDefault(_fs4.default); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getListFile(testFolder) { var listCss = []; var listLiquidCss = []; var listJs = []; var listLiquidJs = []; var listLiquid = []; _fs2.default.readdirSync(testFolder).forEach(function(file) { var pathname = (0, _pathCompleteExtname2.default)(file); if (pathname.indexOf(".css.liquid") !== -1) { listLiquidCss.push(file); } else if (pathname.indexOf(".js.liquid") !== -1) { listLiquidJs.push(file); } else if (pathname.indexOf(".liquid") !== -1) { listLiquid.push(file); } else if (pathname.indexOf(".scss") !== -1) { listCss.push(file); } else if (pathname.indexOf(".js") !== -1) { listJs.push(file); } }); var jsonReturn = { listCss: listCss, listJs: listJs, listLiquidCss: listLiquidCss, listLiquidJs: listLiquidJs, listLiquid: listLiquid }; console.log(jsonReturn); return jsonReturn; } exports.getListFile = getListFile;