diff --git a/site/scripts/update_template.js b/site/scripts/update_template.js index 42f7b63186..814d402f5e 100644 --- a/site/scripts/update_template.js +++ b/site/scripts/update_template.js @@ -1,19 +1,19 @@ const sh = require('shelljs'); -const fs = require('fs') +const fs = require('fs'); -sh.cd(__dirname+'/../') +sh.cd(__dirname+'/../'); // fetch svelte app -sh.rm('-rf','scripts/svelte-app') -sh.exec('npx degit sveltejs/template#v3 scripts/svelte-app') +sh.rm('-rf','scripts/svelte-app'); +sh.exec('npx degit sveltejs/template scripts/svelte-app'); // remove src (will be recreated client-side) and node_modules -sh.rm('-rf', 'scripts/svelte-app/src') -sh.rm('-rf', 'scripts/svelte-app/node_modules') +sh.rm('-rf', 'scripts/svelte-app/src'); +sh.rm('-rf', 'scripts/svelte-app/node_modules'); // build svelte-app.json -const appPath = 'scripts/svelte-app' -let files = [] +const appPath = 'scripts/svelte-app'; +const files = []; for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) { files.push({ path: path.slice(appPath.length + 1), data: fs.readFileSync(path).toString() });