Skip to content

Commit 12c2408

Browse files
committed
Fix accept absolute paths
1 parent 7764258 commit 12c2408

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

lib/cli.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { getConfigFileName, readFilesFromTsconfig } from "./utils";
1515

1616
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json")).toString());
1717

18+
const resolvePath = (filePath: string) => path.isAbsolute(filePath) ? filePath : path.join(process.cwd(), filePath);
19+
1820
interface RootOptions {
1921
replace: boolean;
2022
verify: boolean;
@@ -64,10 +66,10 @@ let root = commandpost
6466
let editorconfig = !!opts.editorconfig;
6567
let vscode = !!opts.vscode;
6668
let tsfmt = !!opts.tsfmt;
67-
let tsconfigFile = opts.useTsconfig[0] ? path.join(process.cwd(), opts.useTsconfig[0]) : null;
68-
let tslintFile = opts.useTslint[0] ? path.join(process.cwd(), opts.useTslint[0]) : null;
69-
let vscodeFile = opts.useVscode[0] ? path.join(process.cwd(), opts.useVscode[0]) : null;
70-
let tsfmtFile = opts.useTsfmt[0] ? path.join(process.cwd(), opts.useTsfmt[0]) : null;
69+
let tsconfigFile = opts.useTsconfig[0] ? resolvePath(opts.useTsconfig[0]) : null;
70+
let tslintFile = opts.useTslint[0] ? resolvePath(opts.useTslint[0]) : null;
71+
let vscodeFile = opts.useVscode[0] ? resolvePath(opts.useVscode[0]) : null;
72+
let tsfmtFile = opts.useTsfmt[0] ? resolvePath(opts.useTsfmt[0]) : null;
7173
let verbose = !!opts.verbose;
7274
let version = !!opts.version;
7375

package-lock.json

Lines changed: 8 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"scripts": {
1010
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
11-
"build": "tslint --fix -c _tslint.json -p tsconfig.json && tsfmt -r && tsc",
11+
"build": "tslint --fix -c _tslint.json -p tsconfig.json && tsc",
1212
"test": "npm run build && mocha --reporter spec --timeout 20000 --require intelli-espower-loader"
1313
},
1414
"keywords": [
@@ -49,7 +49,6 @@
4949
"mocha": "^5.1.0",
5050
"power-assert": "^1.5.0",
5151
"tslint": "^5.1.0",
52-
"typescript": ">=3.0.0-rc",
53-
"typescript-formatter": "^7.2.2"
52+
"typescript": ">=3.0.0-rc"
5453
}
5554
}

0 commit comments

Comments
 (0)