Commit 973b3c0c authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Allow single theme dump

parent 727d133e
......@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Next version (to be released)
### Added
- Command for themes dump (`npm run dump`) can take an argument to only dump a specific theme (example `npm run dump fuel`)
### Changed
- Updated theme for shop/craft/office (add various kind of shop-like amenities, restrict offices list)
......
......@@ -13,6 +13,10 @@ if(!fs.existsSync(DUMP_DIR)) {
fs.mkdirSync(DUMP_DIR, { recursive: true });
}
// Look if user set a precise theme to dump
const args = process.argv.slice(2);
let dumpTheme = args.length === 1 ? args[0] : null;
// Create dump for each theme
const nextTheme = () => {
const theme = themes.full.shift();
......@@ -27,6 +31,10 @@ const nextTheme = () => {
return nextTheme();
}
if(dumpTheme && dumpTheme !== theme.id) {
return nextTheme();
}
db.createDumpTheme(theme, {
baseUrl: (CONFIG.API_BASE_URL || "http://localhost:3000") + "/dump",
destinationFolder: DUMP_DIR
......@@ -37,5 +45,5 @@ const nextTheme = () => {
});
};
console.log("Dumping all themes");
console.log(dumpTheme ? "Dumping specified theme" : "Dumping all themes");
nextTheme();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment