Skip to content

Commit 21e31db

Browse files
committed
output
1 parent 938972c commit 21e31db

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/commands/tsgen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {StackConnectionConfig} from '../types'
88

99
function createOutputPath(outputFile: string) {
1010
const outputPath = path.resolve(
11-
__dirname,
11+
sanitizePath(process.cwd()),
1212
sanitizePath(outputFile),
1313
)
1414
console.log(outputPath,"Output Path is showed");
15+
console.log("Output File", outputFile)
1516
const dirName = path.dirname(outputPath)
1617

1718
fs.mkdirSync(dirName, {recursive: true})

tests/integration/tsgen.integration.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ describe("Integration Test for tsgen command", () => {
2424
const result = spawnSync(cmd, args, { encoding: "utf-8" });
2525

2626
expect(result.status).toBe(0); // Command should exit successfully
27+
console.log("FullOutputPath", outputFilePath);
28+
console.log("Directory", __dirname);
29+
console.log("Directory", process.cwd());
2730
expect(fs.existsSync(outputFilePath)).toBeTruthy();
2831

2932
const generatedContent = fs.readFileSync(outputFilePath, "utf8");
@@ -45,6 +48,9 @@ describe("Integration Test for tsgen command", () => {
4548
prefix,
4649
];
4750

51+
console.log("FullOutputPath", outputFilePath);
52+
console.log("Directory", __dirname);
53+
console.log("Directory", process.cwd());
4854
const result = spawnSync(cmd, args, { encoding: "utf-8" });
4955

5056
expect(result.status).toBe(0);
@@ -70,7 +76,7 @@ describe("Integration Test for tsgen command", () => {
7076
const args = ["tsgen", "-a", tokenAlias, "-o", outputFilePath, "--no-doc"];
7177

7278
const result = spawnSync(cmd, args, { encoding: "utf-8" });
73-
79+
7480
expect(result.status).toBe(0);
7581
expect(fs.existsSync(outputFilePath)).toBeTruthy();
7682

@@ -94,7 +100,7 @@ describe("Integration Test for tsgen command", () => {
94100

95101
expect(result.status).toBe(0);
96102
expect(fs.existsSync(outputFilePath)).toBeTruthy();
97-
103+
98104
const generatedContent = fs.readFileSync(outputFilePath, "utf8");
99105
expect(generatedContent).toContain("export interface SystemFields");
100106
expect(generatedContent).toContain("extends SystemFields");

0 commit comments

Comments
 (0)