feat(cli): find root dir
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { join } from 'path';
|
||||
import { exec } from 'shelljs';
|
||||
import { ROOT } from '../common/constant';
|
||||
|
||||
export function changelog(dist: string, cmd: { tag?: string }) {
|
||||
const basepath = process.cwd();
|
||||
const tag = cmd.tag || 'v1.0.0';
|
||||
|
||||
exec(`
|
||||
basepath=${basepath}
|
||||
basepath=${ROOT}
|
||||
|
||||
github_changelog_generator \
|
||||
--header-label "# 更新日志" \
|
||||
@@ -18,6 +18,6 @@ export function changelog(dist: string, cmd: { tag?: string }) {
|
||||
--no-author \
|
||||
--no-unreleased \
|
||||
--since-tag ${tag} \
|
||||
-o ${join(basepath, dist)}
|
||||
-o ${join(ROOT, dist)}
|
||||
`);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { runCLI } from 'jest';
|
||||
import { setNodeEnv } from '../common';
|
||||
import { genPackageEntry } from '../compiler/gen-package-entry';
|
||||
import { CWD, JEST_CONFIG_FILE, PACKAGE_ENTRY_FILE } from '../common/constant';
|
||||
import { ROOT, JEST_CONFIG_FILE, PACKAGE_ENTRY_FILE } from '../common/constant';
|
||||
|
||||
export function test(command: any) {
|
||||
setNodeEnv('test');
|
||||
@@ -11,10 +11,10 @@ export function test(command: any) {
|
||||
});
|
||||
|
||||
const config = {
|
||||
rootDir: CWD,
|
||||
rootDir: ROOT,
|
||||
watch: command.watch,
|
||||
config: JEST_CONFIG_FILE
|
||||
} as any;
|
||||
|
||||
runCLI(config, [CWD]);
|
||||
runCLI(config, [ROOT]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user