Skip to content

Commit

Permalink
cli: Fix build files being placed outside the build directory (#1698)
Browse files Browse the repository at this point in the history
* cli: Fix build files being placed outside the build directory

* cli: Add changeset
  • Loading branch information
soilking authored Jul 29, 2024
1 parent bc00873 commit c8ec890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-zebras-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': patch
---

Fix build files being placed outside the build directory
4 changes: 2 additions & 2 deletions packages/cli/src/compiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ export default class Compiler {
spinner: Spinner,
) {
const absoluteSourceFile = path.resolve(sourceDir, maybeRelativeFile);
const relativeSourceFile = path.relative(sourceDir, absoluteSourceFile);
const targetFile = path.join(targetDir, relativeSourceFile);
const baseName = path.basename(absoluteSourceFile);
const targetFile = path.join(targetDir, baseName);
step(spinner, 'Write subgraph file', this.displayPath(targetFile));
fs.mkdirsSync(path.dirname(targetFile));
fs.writeFileSync(targetFile, data);
Expand Down

0 comments on commit c8ec890

Please sign in to comment.