Skip to content

Commit

Permalink
fix: Use absolute path to read json files
Browse files Browse the repository at this point in the history
  • Loading branch information
7nohe committed May 19, 2024
1 parent b583eb7 commit 1be3cee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:
- uses: pnpm/action-setup@v3
with:
version: 9
- name: install node.js
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: install dependencies
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: run test
run: sh test.sh

- name: archive generated files
- name: Archive generated files
uses: actions/upload-artifact@v4
with:
name: generated-file-${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function generate(options: CLIOptions) {
// Read model data from JSON file
try {
const modelJson = JSON.parse(
fs.readFileSync(path.join(tmpDir, `${modelName}.json`), "utf8")
fs.readFileSync(path.resolve(tmpDir, `${modelName}.json`), "utf8")
) as LaravelModelType;
modelData.push(modelJson);
} catch {
Expand Down

0 comments on commit 1be3cee

Please sign in to comment.