create-interval-app
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -21,27 +21,2 @@ "use strict"; | ||
const TEMPLATES = ['basic', 'refund-user-tutorial']; | ||
function child(cmd, args, options) { | ||
return new Promise((resolve, reject) => { | ||
const childProc = child_process_1.default.spawn(cmd, args, options); | ||
if (childProc === null || | ||
childProc.stderr === null || | ||
childProc.stdout === null) { | ||
return reject(); | ||
} | ||
childProc.stdout.setEncoding('utf-8'); | ||
childProc.stderr.setEncoding('utf-8'); | ||
childProc.stdout.on('data', data => { | ||
process.stdout.write(data); | ||
}); | ||
childProc.stderr.on('data', data => { | ||
process.stderr.write(data); | ||
}); | ||
childProc.on('close', code => { | ||
console.log(`child process exited with code ${code}`); | ||
if (code !== null && code > 0) { | ||
return reject(code); | ||
} | ||
return resolve(0); | ||
}); | ||
}); | ||
} | ||
async function clone(args) { | ||
@@ -119,2 +94,3 @@ const emitter = (0, tiged_1.default)(`interval/interval-examples/${args.template}/${args.language}`, { | ||
} | ||
console.log(`Creating an Interval app with the ${args.template} template...`); | ||
console.log('Fetching app template...'); | ||
@@ -148,6 +124,11 @@ try { | ||
const langName = args.language === 'javascript' ? 'JavaScript' : 'TypeScript'; | ||
const packageManager = isYarn ? 'yarn' : 'npm'; | ||
let startCommand = `${packageManager} start`; | ||
if (args.language === 'typescript') { | ||
startCommand = isYarn ? `yarn dev` : `npm run dev`; | ||
} | ||
const lines = [ | ||
'To run your app:', | ||
`1. cd ./${args.destination}`, | ||
isYarn ? `2. yarn start` : `2. npm start`, | ||
`2. ${startCommand}`, | ||
]; | ||
@@ -154,0 +135,0 @@ console.log(); |
{ | ||
"name": "create-interval-app", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Quickly bootstrap a new Interval project.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -33,36 +33,2 @@ import degit from 'tiged' | ||
type SpawnOptions = Parameters<typeof childProcess.spawn>[2] | ||
function child(cmd: string, args: any[], options: SpawnOptions) { | ||
return new Promise<number>((resolve, reject) => { | ||
const childProc = childProcess.spawn(cmd, args, options) | ||
if ( | ||
childProc === null || | ||
childProc.stderr === null || | ||
childProc.stdout === null | ||
) { | ||
return reject() | ||
} | ||
childProc.stdout.setEncoding('utf-8') | ||
childProc.stderr.setEncoding('utf-8') | ||
childProc.stdout.on('data', data => { | ||
process.stdout.write(data) | ||
}) | ||
childProc.stderr.on('data', data => { | ||
process.stderr.write(data) | ||
}) | ||
childProc.on('close', code => { | ||
console.log(`child process exited with code ${code}`) | ||
if (code !== null && code > 0) { | ||
return reject(code) | ||
} | ||
return resolve(0) | ||
}) | ||
}) | ||
} | ||
async function clone(args: IntervalAppArgs) { | ||
@@ -163,2 +129,4 @@ const emitter = degit( | ||
console.log(`Creating an Interval app with the ${args.template} template...`) | ||
console.log('Fetching app template...') | ||
@@ -204,6 +172,13 @@ | ||
const packageManager = isYarn ? 'yarn' : 'npm' | ||
let startCommand = `${packageManager} start` | ||
if (args.language === 'typescript') { | ||
startCommand = isYarn ? `yarn dev` : `npm run dev` | ||
} | ||
const lines = [ | ||
'To run your app:', | ||
`1. cd ./${args.destination}`, | ||
isYarn ? `2. yarn start` : `2. npm start`, | ||
`2. ${startCommand}`, | ||
] | ||
@@ -210,0 +185,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12488
400