Skip to content

Commit

Permalink
remove unnecessary platform check
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Jan 16, 2025
1 parent 9e36d8e commit 85e72bb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/command-helpers/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
'..',
'..',
'..',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
'..',
'..',
'..',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions packages/cli/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
Expand Down

0 comments on commit 85e72bb

Please sign in to comment.