这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions __tests__/command_helpers/getSolidaritySettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ describe('basic getSolidaritySettings', () => {
}).toThrowError('ERROR: Found, but no requirements key. Please validate your solidarity file')
process.chdir('../../../')
})
}
})
})

describe('parameterized getSolidaritySettings', () => {

test('custom path with -f', () => {
context.parameters.options = { f: '__tests__/sandbox/solidarity_json' }
const resultSettings = getSolidaritySettings(context)
Expand Down Expand Up @@ -113,7 +112,5 @@ describe('parameterized getSolidaritySettings', () => {
afterAll(() => {
process.chdir('../../../')
})

})

})
15 changes: 10 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@ import { build } from 'gluegun'

module.exports = async (): Promise<void> => {
// setup the runtime
build()
const cli = build()
.brand('solidarity')
.src(__dirname)
// local installs
.plugins('./node_modules', { matching: 'solidarity-*', hidden: true })
// global installs
.plugins('/usr/local/lib/node_modules', { matching: 'solidarity-*', hidden: true }) // Darwin
.plugins(`${process.env.appdata}/npm/node_modules`, { matching: 'solidarity-*', hidden: true }) // Windows
// for testing - force load a local plugin
// .plugin('../solidarity-react-native')
.create()
.run()
// for testing - force load a local plugin
// .plugin('../solidarity-react-native')

// when a module parameter is passed we take the plugins from there, too
const parsedArgs = require('yargs-parser')(process.argv.slice(2))
const moduleName = parsedArgs.m || parsedArgs.module
if (moduleName) cli.plugins(`./node_modules/${moduleName}/node_modules`, { matching: 'solidarity-*', hidden: true })

cli.create().run()
}

export * from './types'