This repository has been archived by the owner on Nov 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add postinstall scripts which throw an error if the os or cpu is diff…
…erent to what the package supports This is a required for npm ci to work. npm/cli#558
- Loading branch information
1 parent
2d3e3b9
commit 2b961f6
Showing
10 changed files
with
135 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
], | ||
"cpu": [ | ||
"ia32" | ||
] | ||
], | ||
"scripts": { | ||
"postinstall": "node ./postinstall.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const { name, os, cpu } = require("./package.json"); | ||
|
||
if (os && !os.includes(process.platform)) { | ||
throw new Error( | ||
`${name} does not support the platform you are using. You are using: "${ | ||
process.platform | ||
}" and ${name} supports: ${os.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} | ||
|
||
if (cpu && !cpu.includes(process.arch)) { | ||
throw new Error( | ||
`${name} does not support the cpu you are using. You are using: "${ | ||
process.arch | ||
}" and ${name} supports: ${cpu.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
], | ||
"cpu": [ | ||
"x64" | ||
] | ||
], | ||
"scripts": { | ||
"postinstall": "node ./postinstall.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const { name, os, cpu } = require("./package.json"); | ||
|
||
if (os && !os.includes(process.platform)) { | ||
throw new Error( | ||
`${name} does not support the platform you are using. You are using: "${ | ||
process.platform | ||
}" and ${name} supports: ${os.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} | ||
|
||
if (cpu && !cpu.includes(process.arch)) { | ||
throw new Error( | ||
`${name} does not support the cpu you are using. You are using: "${ | ||
process.arch | ||
}" and ${name} supports: ${cpu.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,8 @@ | |
}, | ||
"os": [ | ||
"darwin" | ||
] | ||
], | ||
"scripts": { | ||
"postinstall": "node ./postinstall.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const { name, os, cpu } = require("./package.json"); | ||
|
||
if (os && !os.includes(process.platform)) { | ||
throw new Error( | ||
`${name} does not support the platform you are using. You are using: "${ | ||
process.platform | ||
}" and ${name} supports: ${os.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} | ||
|
||
if (cpu && !cpu.includes(process.arch)) { | ||
throw new Error( | ||
`${name} does not support the cpu you are using. You are using: "${ | ||
process.arch | ||
}" and ${name} supports: ${cpu.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
], | ||
"cpu": [ | ||
"ia32" | ||
] | ||
], | ||
"scripts": { | ||
"postinstall": "node ./postinstall.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const { name, os, cpu } = require("./package.json"); | ||
|
||
if (os && !os.includes(process.platform)) { | ||
throw new Error( | ||
`${name} does not support the platform you are using. You are using: "${ | ||
process.platform | ||
}" and ${name} supports: ${os.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} | ||
|
||
if (cpu && !cpu.includes(process.arch)) { | ||
throw new Error( | ||
`${name} does not support the cpu you are using. You are using: "${ | ||
process.arch | ||
}" and ${name} supports: ${cpu.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
], | ||
"cpu": [ | ||
"x64" | ||
] | ||
], | ||
"scripts": { | ||
"postinstall": "node ./postinstall.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use strict"; | ||
|
||
const { name, os, cpu } = require("./package.json"); | ||
|
||
if (os && !os.includes(process.platform)) { | ||
throw new Error( | ||
`${name} does not support the platform you are using. You are using: "${ | ||
process.platform | ||
}" and ${name} supports: ${os.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} | ||
|
||
if (cpu && !cpu.includes(process.arch)) { | ||
throw new Error( | ||
`${name} does not support the cpu you are using. You are using: "${ | ||
process.arch | ||
}" and ${name} supports: ${cpu.join( | ||
"," | ||
)}. If you think this is a mistake, please contact Origami or open an issue on https://github.com/Financial-Times/sass/issues` | ||
); | ||
} |