Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
Add initial support for composer plugins (#59)
Browse files Browse the repository at this point in the history
* Add support for composer plugins

* Permit omitting any component of a plugin
  • Loading branch information
tardieu authored May 22, 2018
1 parent ce44f49 commit a8c1c9c
Show file tree
Hide file tree
Showing 2 changed files with 417 additions and 363 deletions.
12 changes: 10 additions & 2 deletions bin/compose
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
const fs = require('fs')
const vm = require('vm')
const minimist = require('minimist')
const composer = require('../composer')
let composer = require('../composer')

const argv = minimist(process.argv.slice(2), {
string: ['apihost', 'auth', 'deploy', 'lower', 'entity', 'entities'],
string: ['apihost', 'auth', 'deploy', 'lower', 'entity', 'entities', 'string'],
boolean: ['insecure', 'encode', 'json', 'version', 'quiet'],
alias: { auth: 'u', insecure: 'i', version: 'v' }
})
Expand Down Expand Up @@ -40,10 +40,18 @@ if (argv._.length !== 1 || count > 1 || argv.deploy === '' || argv.entity === ''
console.error(' -i, --insecure bypass certificate checking')
console.error(' -v, --version output the composer version')
console.error(' --quiet omit detailed diagnostic messages')
console.error(' --plugin PLUGIN register a composer plugin')
process.exit(127)
}

try {
switch (typeof argv.plugin) {
case 'string':
composer = composer.register(require(argv.plugin))
break
case 'object':
for (let plugin of argv.plugin) composer = composer.register(require(plugin))
}
const filename = argv._[0]
let source
try {
Expand Down
Loading

0 comments on commit a8c1c9c

Please sign in to comment.