Skip to content

Commit d513380

Browse files
committed
fix: support absolute paths for --diagram-file #16
1 parent b8d57c1 commit d513380

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async function main() {
7979

8080
const rootDir = args._[0] || '.';
8181
const configPath = path.join(rootDir, 'wokwi.toml');
82-
const diagramFilePath = path.join(rootDir, diagramFile ?? 'diagram.json');
82+
const diagramFilePath = path.resolve(rootDir, diagramFile ?? 'diagram.json');
8383
const configExists = existsSync(configPath);
8484

8585
if (!elf && !configExists) {
@@ -88,7 +88,7 @@ async function main() {
8888
}
8989

9090
if (!existsSync(diagramFilePath)) {
91-
console.error(`Error: diagram.json not found in ${path.resolve(rootDir)}`);
91+
console.error(`Error: diagram file not found in ${diagramFilePath}`);
9292
process.exit(1);
9393
}
9494

0 commit comments

Comments
 (0)