site: use master branch of template in svelte-app

pull/2498/head
Conduitry 5 years ago
parent e039cabbaa
commit d85de6791e

@ -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() });

Loading…
Cancel
Save