File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @graphprotocol/graph-cli ' : patch
3
+ ---
4
+
5
+ error out if node is too old
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
+ import process from 'node:process' ;
3
+ import semver from 'semver' ;
2
4
import { execute } from '@oclif/core' ;
5
+ import { nodeVersion } from '../dist/version.js' ;
6
+
7
+ if ( ! semver . satisfies ( process . version , nodeVersion ) ) {
8
+ process . stderr . write (
9
+ `Node.js version ${ nodeVersion } is required. Current version: ${ process . version } \n` ,
10
+ ) ;
11
+ process . exit ( 1 ) ;
12
+ }
3
13
4
14
await execute ( { dir : import . meta. url } ) ;
Original file line number Diff line number Diff line change @@ -15,3 +15,4 @@ const packageJson = JSON.parse(
15
15
) ;
16
16
17
17
export const version = packageJson . version as string ;
18
+ export const nodeVersion = ( packageJson . engines ?. node ?? '' ) as string ;
You can’t perform that action at this time.
0 commit comments