Skip to content

Commit

Permalink
Attempt new methodology for installer
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Rolon committed Jul 25, 2018
1 parent 15c80bc commit 5d16bf9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
6 changes: 0 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ program
.option('-e --env [env]', 'specify an environment')
.option('-b, --build [env]', 'deploy a theme')
.option('-d, --deploy [env]', 'deploy a theme')
.option('-i, --install', 'install dependencies')
.option('--debug', 'enable available debugging')
.option('--all', 'force deployment of all files')
.parse(process.argv)
Expand All @@ -24,11 +23,6 @@ if (program.debug) {
process.env.DEBUG = '*'
}

if (program.install) {
require('./lib/installer')()
process.exit()
}

process.env.ENV = program.env || 'development'

if (process.env.ENV === 'development') {
Expand Down
19 changes: 5 additions & 14 deletions lib/installer.js → install.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
const Err = require('./error')
const deps = require('./deps.json')
const deps = require('./lib/deps.json')
const {exec} = require('child_process')

class Installer {
constructor () {}

run () {
const dependencies = Object.keys(deps)
.map(key => `${key}@${deps[key]}`)
.join(' ')

this.install(dependencies)
.then(msg => {
console.log(msg)
console.log(msg)
})
.catch(msg => {
console.log(msg)
console.log(msg)
})
}

Expand All @@ -37,11 +34,5 @@ class Installer {
}
}

module.exports = () => {
try {
const installer = new Installer()
return installer.run()
} catch (e) {
new Err(e)
}
}
const installer = new Installer()
installer.run()
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "A build and deployment tool for the devs at Barrel",
"main": "index.js",
"bin": {
"brrl": "./index.js"
"brrl": "./index.js",
"brrl-install": "./lib/install.js"
},
"author": "maxrolon",
"license": "MIT",
Expand Down

0 comments on commit 5d16bf9

Please sign in to comment.