This repository has been archived by the owner on May 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6203031
commit 8594038
Showing
12 changed files
with
11,416 additions
and
6,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
/node_modules | ||
/yarn-error.log | ||
/npm-debug.log | ||
/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
const chalk = require('chalk') | ||
const inquirer = require('inquirer') | ||
const { team } = require('../config') | ||
|
||
module.exports = () => { | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: 'list', | ||
name: 'user', | ||
message: 'Who the heck are you?', | ||
choices: team.map(({ name }) => name) | ||
} | ||
]) | ||
.then(({ user }) => { | ||
console.log( | ||
`Yay, it's ${chalk.bold.green(user)}! My favourite team member.` | ||
) | ||
}) | ||
module.exports = team => { | ||
if (team.length) { | ||
inquirer | ||
.prompt([ | ||
{ | ||
type: 'list', | ||
name: 'user', | ||
message: 'Who the heck are you?', | ||
choices: team.map(({ name }) => name) | ||
} | ||
]) | ||
.then(({ user }) => { | ||
console.log( | ||
`Yay, it's ${chalk.bold.green(user)}! My favourite team member.` | ||
) | ||
}) | ||
} else { | ||
console.log(`Hello!`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const chalk = require('chalk') | ||
|
||
module.exports = () => { | ||
console.log(`Usage: s8 <command> | ||
console.log(`${chalk.green('Usage:')} ${chalk.bold('s8 <command>')} | ||
Where <command> is one of: | ||
Where ${chalk.bold('<command>')} is one of: | ||
hello | ||
install | ||
setup | ||
team | ||
upgrade`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const chalk = require('chalk') | ||
const { exec } = require('child_process') | ||
const { promisify } = require('util') | ||
|
||
const execAsync = promisify(exec) | ||
|
||
module.exports = (hasSetup) => { | ||
if (hasSetup) { | ||
console.log(`${chalk.green(`You've already successfully ran ${chalk.bold('s8 setup')}!`)} | ||
You only have to run this command once. | ||
After that please use ${chalk.bold('s8 upgrade')} to upgrade ${chalk.bold('s8')} and all of its dependencies. | ||
`) | ||
} else { | ||
console.log(chalk.dim('Installing private dependencies...')) | ||
|
||
execAsync('npm i --no-save git+ssh://[email protected]:serieseight/config.git#master') | ||
.then(() => console.log('Private dependencies installed!')) | ||
.then(() => console.log(chalk.bold.green('Setup complete!'))) | ||
.catch(err => console.error(err)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
const chalk = require('chalk') | ||
const { exec } = require('child_process') | ||
const { name } = require('../package.json') | ||
const { promisify } = require('util') | ||
|
||
module.exports = () => { | ||
console.log('Upgrading...') | ||
|
||
exec(`npm i -g ${name}`, (err, stdout, stderr) => { | ||
if (err) { | ||
console.error(err) | ||
const execAsync = promisify(exec) | ||
|
||
return | ||
} | ||
module.exports = () => { | ||
console.log(chalk.dim(`Upgrading ${chalk.bold('s8')}...`)) | ||
|
||
console.log('Upgrade complete. Go forth and build things.') | ||
}) | ||
execAsync(`npm i -g ${name}`) | ||
.then(() => console.log(`${chalk.bold('s8')} upgraded!`)) | ||
.then(() => console.log(chalk.dim('Upgrading private dependencies...'))) | ||
.then(() => execAsync('npm i --no-save git+ssh://[email protected]:serieseight/config.git#master')) | ||
.then(() => console.log('Private dependencies upgraded!')) | ||
.then(() => console.log(chalk.bold.green('Upgrade complete!'))) | ||
.catch(err => console.error(err)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
const chalk = require('chalk') | ||
const { version } = require('../package.json') | ||
|
||
module.exports = () => console.log(version) | ||
module.exports = () => { | ||
console.log(`${chalk.green('Version:')} ${chalk.bold(version)}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.