Skip to content

Commit 85e72bb

Browse files
committed
remove unnecessary platform check
1 parent 9e36d8e commit 85e72bb

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

packages/cli/src/command-helpers/network.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import yaml from 'yaml';
66
import { initNetworksConfig, updateSubgraphNetwork } from './network.js';
77

88
const SUBGRAPH_PATH_BASE = path.join(
9-
`${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`,
9+
fileURLToPath(import.meta.url),
1010
'..',
1111
'..',
1212
'..',

packages/cli/src/commands/local.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default class LocalCommand extends Command {
9494
const composeFile =
9595
composeFileFlag ||
9696
path.join(
97-
`${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`,
97+
fileURLToPath(import.meta.url),
9898
'..',
9999
'..',
100100
'..',

packages/cli/src/subgraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class Subgraph {
5454
const schema = graphql.parse(
5555
await fs.readFile(
5656
path.join(
57-
`${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`,
57+
fileURLToPath(import.meta.url),
5858
'..',
5959
'protocols',
6060
// TODO: substreams/triggers is a special case, should be handled better

packages/cli/src/version.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ const packageJson = JSON.parse(
66
fs
77
.readFileSync(
88
// works even when bundled/built because the path to package.json is the same
9-
path.join(
10-
`${process.platform === 'win32' ? '' : '/'}${fileURLToPath(import.meta.url)}`,
11-
'..',
12-
'..',
13-
'package.json',
14-
),
9+
path.join(fileURLToPath(import.meta.url), '..', '..', 'package.json'),
1510
)
1611
.toString(),
1712
);

0 commit comments

Comments
 (0)