Skip to content

Commit

Permalink
fix(cli): dirname & rm git
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwangchong committed Sep 17, 2023
1 parent 7d20ee2 commit 8223d63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions packages/cli/bin/kever.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/usr/bin/env node --harmony

import { dirname as _dirname, resolve } from 'path'
import { fileURLToPath} from 'url'
import { program } from 'commander'
import { readPackage } from 'read-pkg'
import cli from '../dist/index.mjs'

// eslint-disable-next-line no-undef
const dirname = () => typeof __dirname !== 'undefined' ? __dirname : _dirname(fileURLToPath(import.meta.url))


const run = async () => {
const { version } = await readPackage()
program.version(version, '-v, -V, --version')
const { version } = await readPackage({
cwd: resolve(dirname(), '..')
})
program.version(version, '-v, -V')
program
.command('init')
.description('initial keverjs program')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const gitClone = (projectName: string, gitUrl: string, rmGit = true): Pro
}
resolve(true)
spinner.stopAndPersist(stopOptions)
rmGit && rimrafSync(`./${projectName}.git`)
rmGit && rimrafSync(`./${projectName}/.git`)
})
})
}

0 comments on commit 8223d63

Please sign in to comment.