turbowatch
Advanced tools
Comparing version 1.9.2 to 1.9.3
@@ -24,10 +24,20 @@ #!/usr/bin/env node | ||
.parseSync(); | ||
const scriptPath = node_path_1.default.resolve(process.cwd(), argv.source); | ||
if (!(0, node_fs_1.existsSync)(scriptPath)) { | ||
console.error('%s not found', scriptPath); | ||
let resolvedPath; | ||
const providedPath = node_path_1.default.resolve(process.cwd(), argv.source); | ||
const possiblePaths = [providedPath]; | ||
if (node_path_1.default.extname(providedPath) === '') { | ||
possiblePaths.push(providedPath + '.ts', providedPath + '.js'); | ||
} | ||
for (const possiblePath of possiblePaths) { | ||
if ((0, node_fs_1.existsSync)(possiblePath)) { | ||
resolvedPath = possiblePath; | ||
} | ||
} | ||
if (!resolvedPath) { | ||
console.error('%s not found', providedPath); | ||
process.exitCode = 1; | ||
return; | ||
} | ||
(0, jiti_1.default)(__filename)(scriptPath); | ||
(0, jiti_1.default)(__filename)(resolvedPath); | ||
}; | ||
main(); |
@@ -62,3 +62,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "1.9.2" | ||
"version": "1.9.3" | ||
} |
@@ -30,2 +30,4 @@ # Turbowatch π | ||
> **Note** See [logging](#logging) instructions to print logs that explain what Turbowatch is doing. | ||
Refer to recipes: | ||
@@ -500,3 +502,3 @@ | ||
```bash | ||
tsx turbowatch.ts | roarr | ||
ROARR_LOG=true turbowatch | roarr | ||
``` | ||
@@ -503,0 +505,0 @@ |
62648
956
593