@naturalcycles/cli
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -0,1 +1,8 @@ | ||
# [1.1.0](https://github.com/NaturalCycles/cli/compare/v1.0.5...v1.1.0) (2020-04-04) | ||
### Features | ||
* auto-complete .ts extension ([ddc0cc7](https://github.com/NaturalCycles/cli/commit/ddc0cc71b8313328d326c80313f0d263dbdfd015)) | ||
## [1.0.5](https://github.com/NaturalCycles/cli/compare/v1.0.4...v1.0.5) (2020-04-04) | ||
@@ -2,0 +9,0 @@ |
@@ -19,13 +19,4 @@ #!/usr/bin/env node | ||
const projectTsconfigPath = await ensureProjectTsconfigScripts(); | ||
let [, , scriptPath = '', ..._processArgs] = process.argv; | ||
const [, , _scriptPath = '', ..._processArgs] = process.argv; | ||
const cwd = process.cwd(); | ||
// Prepend ./scripts/ if needed | ||
if (!scriptPath.startsWith('scripts/') && | ||
!scriptPath.startsWith('./') && | ||
!scriptPath.startsWith('/')) { | ||
const newPath = './scripts/' + scriptPath; | ||
if (fs.existsSync(newPath)) { | ||
scriptPath = newPath; | ||
} | ||
} | ||
require('loud-rejection/register'); | ||
@@ -47,6 +38,14 @@ require('dotenv/config'); | ||
} | ||
// Resolve path | ||
// ./scripts/ ... .ts | ||
let scriptPath = [ | ||
_scriptPath, | ||
`${_scriptPath}.ts`, | ||
`./scripts/${_scriptPath}`, | ||
`./scripts/${_scriptPath}.ts`, | ||
].find(fs.existsSync); | ||
scriptPath = require.resolve(`${cwd}/${scriptPath}`); | ||
console.log({ | ||
scriptPath, | ||
}); | ||
// console.log({ | ||
// scriptPath, | ||
// }) | ||
// Should be loadable now due to tsnode being initialized already | ||
@@ -53,0 +52,0 @@ require(scriptPath); |
"use strict"; | ||
// This file exists, because otherwise tsc skips the bin folder and path becomes wrong:( |
@@ -40,3 +40,3 @@ { | ||
}, | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "CLI utils to be installed globally via 'npm i -g'", | ||
@@ -43,0 +43,0 @@ "author": "Natural Cycles Team", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5918