@claudiv/cli 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +4 -3
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import dotenv from 'dotenv';
|
|
5
5
|
import { existsSync, readdirSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
6
|
+
import { join, isAbsolute } from 'path';
|
|
7
7
|
import { logger } from './utils/logger.js';
|
|
8
8
|
// Load .env file
|
|
9
9
|
dotenv.config();
|
|
@@ -32,9 +32,10 @@ export function loadConfig() {
|
|
|
32
32
|
const cliFile = process.argv[2];
|
|
33
33
|
let specFile;
|
|
34
34
|
if (cliFile) {
|
|
35
|
-
|
|
35
|
+
// If path is already absolute, use it directly; otherwise join with cwd
|
|
36
|
+
specFile = isAbsolute(cliFile) ? cliFile : join(process.cwd(), cliFile);
|
|
36
37
|
if (!existsSync(specFile)) {
|
|
37
|
-
logger.error(`File not found: ${
|
|
38
|
+
logger.error(`File not found: ${specFile}`);
|
|
38
39
|
process.exit(1);
|
|
39
40
|
}
|
|
40
41
|
}
|