Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: updated command
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 71a312a commit 79b0796
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 23 deletions.
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -15,16 +15,17 @@
},
"bugs": "https://github.com/anycli/dev-cli/issues",
"dependencies": {
"@anycli/command": "^1.2.14",
"@anycli/config": "^1.3.36",
"@anycli/command": "^1.2.16",
"@anycli/config": "^1.3.40",
"@anycli/errors": "^0.2.1",
"@anycli/plugin-help": "^0.6.9",
"@anycli/plugin-help": "^0.7.0",
"lodash.template": "^4.4.0",
"normalize-package-data": "^2.4.0",
"require-resolve": "^0.0.2"
},
"devDependencies": {
"@anycli/test": "^0.10.13",
"@anycli/plugin-legacy": "^0.1.1",
"@anycli/test": "^0.10.15",
"@anycli/tslint": "^0.2.7",
"@types/chai": "^4.1.2",
"@types/fs-extra": "^5.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/commands/manifest.ts
Expand Up @@ -16,6 +16,7 @@ export default class Manifest extends Command {
const {args} = this.parse(Manifest)
const root = path.resolve(args.path)
let plugin = new Config.Plugin({root, type: 'core', ignoreManifest: true})
await plugin.load()
if (!plugin) throw new Error('plugin not found')
if (!plugin.valid) {
// @ts-ignore
Expand Down
6 changes: 4 additions & 2 deletions src/commands/readme.ts
Expand Up @@ -25,11 +25,13 @@ The readme must have any of the following tags inside of it for it to be replace

async run() {
const {flags} = this.parse(Readme)
const config = Config.load({root: process.cwd(), devPlugins: false, userPlugins: false})
const config = await Config.load({root: process.cwd(), devPlugins: false, userPlugins: false})
try {
// @ts-ignore
let p = require.resolve('@anycli/plugin-legacy', {paths: [process.cwd()]})
config.plugins.push(new Config.Plugin({root: p, type: 'core'}))
let plugin = new Config.Plugin({root: p, type: 'core'})
await plugin.load()
config.plugins.push(plugin)
} catch {}
await config.runHook('init', {id: 'readme', argv: this.argv})
let readme = await fs.readFile('README.md', 'utf8')
Expand Down

0 comments on commit 79b0796

Please sign in to comment.