forked from barrel/barrel-cli
-
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.
1.0.0
- Loading branch information
Showing
11 changed files
with
252 additions
and
176 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env node | ||
'use strict' | ||
|
||
const deps = require('./lib/deps.json') | ||
const {exec} = require('child_process') | ||
|
||
class Installer { | ||
run () { | ||
const dependencies = Object.keys(deps) | ||
.map(key => `${key}@${deps[key]}`) | ||
.join(' ') | ||
|
||
this.install(dependencies) | ||
.then(msg => { | ||
console.log(msg) | ||
}) | ||
.catch(msg => { | ||
console.log(msg) | ||
}) | ||
} | ||
|
||
exec ( command = "ls" ) { | ||
return new Promise( (resolve, reject) => { | ||
exec(command, (err, stdout) => { | ||
if (err) { | ||
console.error(err) | ||
reject(err.message) | ||
return | ||
} | ||
resolve(stdout) | ||
}) | ||
}) | ||
} | ||
|
||
install (dependencies) { | ||
// Last npm i is to recreate full .bin folder | ||
return this.exec(`cd ${process.cwd()} && npm i -D ${dependencies} && npm i`) | ||
} | ||
} | ||
|
||
const installer = new Installer() | ||
installer.run() |
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
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,28 @@ | ||
{ | ||
"autoprefixer": "^7.1.4", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-loader": "^7.1.5", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-plugin-transform-object-assign": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"css-loader": "^0.28.7", | ||
"eslint-loader": "^2.0.0", | ||
"file-loader": "^1.1.11", | ||
"globby": "^5.0.0", | ||
"gulp": "^3.9.1", | ||
"postcss-automath": "^1.0.1", | ||
"postcss-color-function": "^4.0.0", | ||
"postcss-extend": "^1.0.5", | ||
"postcss-fontpath": "^1.0.0", | ||
"postcss-hexrgba": "^1.0.0", | ||
"postcss-import": "^10.0.0", | ||
"postcss-inline-svg": "^3.0.0", | ||
"postcss-loader": "^2.0.6", | ||
"precss": "^2.0.0", | ||
"standard": "^10.0.2", | ||
"style-loader": "^0.18.2", | ||
"url-loader": "^1.0.1", | ||
"webpack": "^4.16.2" | ||
} |
Oops, something went wrong.