UNPKG

slenderman

Version:

slenderman clones and installs slender-template, a simple Svelte app template

3 lines (2 loc) 927 B
#! /usr/bin/env node "use strict";var _require=require("child_process"),execSync=_require.execSync,fs=require("fs"),path=require("path"),chalk=require("chalk"),APPNAME=process.argv[2]?process.argv[2]:"svelteApp",dir=path.resolve(process.cwd(),APPNAME),commands=["mkdir ".concat(APPNAME),"cd ".concat(APPNAME," && npx degit fermentationist/slender-template"),"cd ".concat(APPNAME," && git init"),"cd ".concat(APPNAME," && npm init -y"),"cd ".concat(APPNAME," && npm install"),"cd ".concat(APPNAME," && npm start")];module.exports=APPNAME,fs.stat(dir,function(e,c){e||(console.log(chalk.red("A directory or file with the name ".concat(APPNAME," already exists. Aborting."))),process.exit(9)),commands.forEach(function(e,c){c===commands.length-1&&console.log(chalk.blue("Starting up development server on http://localhost:9000...")),execSync(e),console.log(chalk.green("Bash command - ".concat(e," – has been executed.")))})});