We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fb1838 commit 5c173d2Copy full SHA for 5c173d2
scripts/apply-patches.js
@@ -0,0 +1,28 @@
1
+/**
2
+ * Apply patches in order. Extracted from logic in release-next-major.js.
3
+ */
4
+
5
+const path = require(`path`)
6
+const { execSync } = require(`child_process`)
7
+const glob = require(`glob`)
8
9
+const gatsbyPKG = require(`../packages/gatsby/package.json`)
10
+const nextMajor = String(Number(gatsbyPKG.version.match(/[^.]+/)[0]) + 1)
11
12
+const patchFiles = glob.sync(`patches/v${nextMajor}/*.patch`, {
13
+ cwd: path.join(__dirname, `..`),
14
+})
15
16
+for (const patchFile of patchFiles) {
17
+ console.log(`Applying patch ${patchFile}`)
18
+ try {
19
+ execSync(`git apply ${patchFile}`, {
20
21
+ stdio: `pipe`,
22
+ })
23
+ } catch (err) {
24
+ console.log(err.stderr.toString())
25
+ // eslint-disable-next-line
26
+ throw ``
27
+ }
28
+}
0 commit comments