aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-07 21:31:36 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-02-07 21:31:36 -0800
commit7b5bf62ad581292395ebed37d705ddd892a9a812 (patch)
tree2d71fe5c63d621e2b053e45c76dc2d63a6653f94
parent869eea4bb23e8df7308c978a7c8723ef47e3eea7 (diff)
downloadbun-7b5bf62ad581292395ebed37d705ddd892a9a812.tar.gz
bun-7b5bf62ad581292395ebed37d705ddd892a9a812.tar.zst
bun-7b5bf62ad581292395ebed37d705ddd892a9a812.zip
[bun-macro-relay] resolve the artifact directory
Diffstat (limited to '')
-rw-r--r--packages/bun-macro-relay/bun-macro-relay.tsx13
1 files changed, 2 insertions, 11 deletions
diff --git a/packages/bun-macro-relay/bun-macro-relay.tsx b/packages/bun-macro-relay/bun-macro-relay.tsx
index a6777d65d..b2ae22225 100644
--- a/packages/bun-macro-relay/bun-macro-relay.tsx
+++ b/packages/bun-macro-relay/bun-macro-relay.tsx
@@ -1,4 +1,5 @@
import { parse, print } from "graphql/index.js";
+import { resolve } from "path";
//
// 1. Parse the GraphQL tag.
@@ -21,17 +22,7 @@ if (BUN_MACRO_RELAY_ARTIFACT_DIRECTORY) {
artifactDirectory = BUN_MACRO_RELAY_ARTIFACT_DIRECTORY;
}
-// TODO: platform-independent path cleaning
-if (!artifactDirectory.startsWith("/")) {
- while (artifactDirectory.endsWith("/")) {
- artifactDirectory = artifactDirectory.substring(
- 0,
- artifactDirectory.length - 1
- );
- }
-
- artifactDirectory = Bun.cwd + artifactDirectory;
-}
+artifactDirectory = resolve(artifactDirectory);
export function graphql(node) {
let query;