diff --git a/packages/cli/src/command-helpers/network.test.ts b/packages/cli/src/command-helpers/network.test.ts index 9d7cfc4d3..bc222be9c 100644 --- a/packages/cli/src/command-helpers/network.test.ts +++ b/packages/cli/src/command-helpers/network.test.ts @@ -6,7 +6,7 @@ import yaml from 'yaml'; import { initNetworksConfig, updateSubgraphNetwork } from './network.js'; const SUBGRAPH_PATH_BASE = path.join( - `${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`, + fileURLToPath(import.meta.url), '..', '..', '..', diff --git a/packages/cli/src/commands/local.ts b/packages/cli/src/commands/local.ts index 7cc96197d..b9bd3b8db 100644 --- a/packages/cli/src/commands/local.ts +++ b/packages/cli/src/commands/local.ts @@ -94,7 +94,7 @@ export default class LocalCommand extends Command { const composeFile = composeFileFlag || path.join( - `${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`, + fileURLToPath(import.meta.url), '..', '..', '..', diff --git a/packages/cli/src/subgraph.ts b/packages/cli/src/subgraph.ts index d36761b65..93b84fcf4 100644 --- a/packages/cli/src/subgraph.ts +++ b/packages/cli/src/subgraph.ts @@ -54,7 +54,7 @@ export default class Subgraph { const schema = graphql.parse( await fs.readFile( path.join( - `${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`, + fileURLToPath(import.meta.url), '..', 'protocols', // TODO: substreams/triggers is a special case, should be handled better diff --git a/packages/cli/src/version.ts b/packages/cli/src/version.ts index 27932ee86..e9fee6872 100644 --- a/packages/cli/src/version.ts +++ b/packages/cli/src/version.ts @@ -6,12 +6,7 @@ const packageJson = JSON.parse( fs .readFileSync( // works even when bundled/built because the path to package.json is the same - path.join( - `${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`, - '..', - '..', - 'package.json', - ), + path.join(fileURLToPath(import.meta.url), '..', '..', 'package.json'), ) .toString(), );