Skip to content

Commit

Permalink
Prepare npm release as spago-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Dec 3, 2023
1 parent 11e68ec commit bd62a15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions npm/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const fetch = require("make-fetch-happen");
const tar = require("tar");
const version = "PACKAGE_VERSION";
const version = "0.21.0";
const platform = { win32: "Windows", darwin: "macOS" }[process.platform] || "Linux";
const url = `https://github.com/purescript/spago/releases/download/${version}/${platform}.tar.gz`

fetch(url).then(res => res.body.pipe(tar.x({"C": './'})));
fetch(url).then(res => res.body.pipe(tar.x({ "C": './' })));
12 changes: 6 additions & 6 deletions npm/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "spago",
"version": "NPM_VERSION",
"description": "🍝 PureScript package manager and build tool powered by Dhall and package-sets",
"homepage": "https://github.com/purescript/spago",
"name": "spago-legacy",
"version": "0.21.0",
"description": "[DEPRECATED] 🍝 PureScript package manager and build tool powered by Dhall and package-sets",
"homepage": "https://github.com/purescript/spago-legacy",
"repository": {
"type": "git",
"url": "https://github.com/purescript/spago.git"
"url": "https://github.com/purescript/spago-legacy.git"
},
"scripts": {
"postinstall": "node ./install.js"
},
"author": "Justin Woo, Fabrizio Ferrai",
"bin": {
"spago": "./spago"
"spago-legacy": "./spago-legacy"
},
"dependencies": {
"make-fetch-happen": "^11.0.1",
Expand Down
6 changes: 3 additions & 3 deletions npm/spago → npm/spago-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const cp = require("child_process");

// Ignore SIGINT (Ctrl-C) because we don't want to terminate this process from
// it (#483). Spago.exe will handle it for us
process.on('SIGINT', () => {});
process.on('SIGINT', () => { });

const spago = cp.spawn(__dirname + '/spago.exe', process.argv.slice(2), {stdio: 'inherit'});
const spago = cp.spawn(__dirname + '/spago-legacy.exe', process.argv.slice(2), { stdio: 'inherit' });
spago.on('error', (err) => {
console.log("Downloading the spago binary failed. Please try reinstalling the spago npm package.");
console.log("Downloading the spago-legacy binary failed. Please try reinstalling the spago-legacy npm package.");
});
spago.on('exit', (code) => {
process.exit(code);
Expand Down

0 comments on commit bd62a15

Please sign in to comment.