Skip to content

Commit a4f0745

Browse files
Remove skip-git deprecation warning (#1866)
* show skip-git deprecation warning only when used * update tests * fixes #1852
1 parent 4ddb562 commit a4f0745

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

.changeset/gorgeous-flies-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphprotocol/graph-cli': patch
3+
---
4+
5+
show skip-git deprecation warning only when used

packages/cli/src/commands/init.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ export default class InitCommand extends Command {
8181
'skip-git': Flags.boolean({
8282
summary: 'Skip initializing a Git repository.',
8383
default: false,
84-
deprecated: {
85-
message:
86-
'In next major version, this flag will be removed. By default we will stop initializing a Git repository.',
87-
},
8884
}),
8985
'start-block': Flags.string({
9086
helpGroup: 'Scaffold from contract',
@@ -142,6 +138,12 @@ export default class InitCommand extends Command {
142138

143139
initDebugger('Flags: %O', flags);
144140

141+
if (skipGit) {
142+
this.warn(
143+
'The --skip-git flag will be removed in the next major version. By default we will stop initializing a Git repository.',
144+
);
145+
}
146+
145147
const { node } = chooseNodeUrl({
146148
node: nodeFlag,
147149
});

packages/cli/tests/cli/__snapshots__/init.test.ts.snap

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`Init > Ethereum > From contract 1`] = `
4-
" › Warning: In next major version, this flag will be removed. By default we
5-
› will stop initializing a Git repository.
4+
" › Warning: The --skip-git flag will be removed in the next major version. By
5+
default we will stop initializing a Git repository.
66
- Create subgraph scaffold
77
Generate subgraph
88
- Create subgraph scaffold
@@ -37,8 +37,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
3737
`;
3838

3939
exports[`Init > Ethereum > From contract with abi 1`] = `
40-
" › Warning: In next major version, this flag will be removed. By default we
41-
› will stop initializing a Git repository.
40+
" › Warning: The --skip-git flag will be removed in the next major version. By
41+
default we will stop initializing a Git repository.
4242
- Create subgraph scaffold
4343
Generate subgraph
4444
- Create subgraph scaffold
@@ -73,8 +73,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
7373
`;
7474

7575
exports[`Init > Ethereum > From contract with abi and structs 1`] = `
76-
" › Warning: In next major version, this flag will be removed. By default we
77-
› will stop initializing a Git repository.
76+
" › Warning: The --skip-git flag will be removed in the next major version. By
77+
default we will stop initializing a Git repository.
7878
- Create subgraph scaffold
7979
Generate subgraph
8080
- Create subgraph scaffold
@@ -109,8 +109,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
109109
`;
110110

111111
exports[`Init > Ethereum > From contract with index events and abi with ID in events 1`] = `
112-
" › Warning: In next major version, this flag will be removed. By default we
113-
› will stop initializing a Git repository.
112+
" › Warning: The --skip-git flag will be removed in the next major version. By
113+
default we will stop initializing a Git repository.
114114
- Create subgraph scaffold
115115
Generate subgraph
116116
- Create subgraph scaffold
@@ -145,8 +145,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
145145
`;
146146

147147
exports[`Init > Ethereum > From contract with list items in abi 1`] = `
148-
" › Warning: In next major version, this flag will be removed. By default we
149-
› will stop initializing a Git repository.
148+
" › Warning: The --skip-git flag will be removed in the next major version. By
149+
default we will stop initializing a Git repository.
150150
- Create subgraph scaffold
151151
Generate subgraph
152152
- Create subgraph scaffold
@@ -181,8 +181,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
181181
`;
182182

183183
exports[`Init > Ethereum > From contract with overloaded elements 1`] = `
184-
" › Warning: In next major version, this flag will be removed. By default we
185-
› will stop initializing a Git repository.
184+
" › Warning: The --skip-git flag will be removed in the next major version. By
185+
default we will stop initializing a Git repository.
186186
- Create subgraph scaffold
187187
Generate subgraph
188188
- Create subgraph scaffold
@@ -217,8 +217,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
217217
`;
218218

219219
exports[`Init > Ethereum > From example 1`] = `
220-
" › Warning: In next major version, this flag will be removed. By default we
221-
› will stop initializing a Git repository.
220+
" › Warning: The --skip-git flag will be removed in the next major version. By
221+
default we will stop initializing a Git repository.
222222
- Cloning example subgraph
223223
✔ Cloning example subgraph
224224
- Initialize networks config
@@ -251,8 +251,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
251251
`;
252252

253253
exports[`Init > NEAR > From contract 1`] = `
254-
" › Warning: In next major version, this flag will be removed. By default we
255-
› will stop initializing a Git repository.
254+
" › Warning: The --skip-git flag will be removed in the next major version. By
255+
default we will stop initializing a Git repository.
256256
- Create subgraph scaffold
257257
Generate subgraph
258258
- Create subgraph scaffold

0 commit comments

Comments
 (0)