rustywind 0.23.1 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.js +1 -1
- package/lib/download-release.js +29 -29
- package/lib/download.js +47 -36
- package/lib/postinstall.js +22 -8
- package/package.json +2 -2
- package/release.json +94 -152
- package/lib/install.js +0 -107
package/lib/constants.js
CHANGED
package/lib/download-release.js
CHANGED
|
@@ -9,46 +9,46 @@ const get = require("./get");
|
|
|
9
9
|
* @param {string} tag
|
|
10
10
|
*/
|
|
11
11
|
function getApiUrl(repo, tag) {
|
|
12
|
-
|
|
12
|
+
return `https://api.github.com/repos/${repo}/releases/tags/${tag}`;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {{ token?: string; version: string; }} opts
|
|
17
17
|
*/
|
|
18
18
|
async function getReleaseFromGitHubApi(opts) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
const downloadOpts = {
|
|
20
|
+
headers: {
|
|
21
|
+
"user-agent": "rustywind",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (opts.token) {
|
|
26
|
+
downloadOpts.headers.authorization = `token ${opts.token}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(`Finding rustywind ${opts.version} release`);
|
|
30
|
+
const release = await get(getApiUrl(REPO, opts.version), downloadOpts);
|
|
31
|
+
let jsonRelease;
|
|
32
|
+
try {
|
|
33
|
+
jsonRelease = JSON.parse(release);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
throw new Error("Malformed API response: " + e.stack);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!jsonRelease.assets) {
|
|
39
|
+
throw new Error("Bad API response: " + JSON.stringify(release));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return jsonRelease;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @param {{ token?: string; version: string; }} opts
|
|
47
47
|
*/
|
|
48
48
|
module.exports = async (opts) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
if (!opts.version) {
|
|
50
|
+
return Promise.reject(new Error("Missing version"));
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
return getReleaseFromGitHubApi(opts);
|
|
54
54
|
};
|
package/lib/download.js
CHANGED
|
@@ -11,8 +11,6 @@ const URL = url.URL;
|
|
|
11
11
|
const child_process = require("child_process");
|
|
12
12
|
const proxy_from_env = require("proxy-from-env");
|
|
13
13
|
|
|
14
|
-
const get = require("./get");
|
|
15
|
-
|
|
16
14
|
const packageVersion = require("../package.json").version;
|
|
17
15
|
const tmpDir = path.join(os.tmpdir(), `rustywind-cache-${packageVersion}`);
|
|
18
16
|
|
|
@@ -79,10 +77,11 @@ function downloadWin(url, dest, opts) {
|
|
|
79
77
|
});
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
function download(_url, dest, opts) {
|
|
80
|
+
async function download(_url, dest, opts) {
|
|
81
|
+
// Handle proxy setup
|
|
83
82
|
const proxy = proxy_from_env.getProxyForUrl(url.parse(_url));
|
|
84
|
-
if (proxy
|
|
85
|
-
|
|
83
|
+
if (proxy) {
|
|
84
|
+
const HttpsProxyAgent = require("https-proxy-agent");
|
|
86
85
|
opts = {
|
|
87
86
|
...opts,
|
|
88
87
|
agent: new HttpsProxyAgent(proxy),
|
|
@@ -90,46 +89,56 @@ function download(_url, dest, opts) {
|
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
// Windows-specific handling
|
|
93
93
|
if (isWindows) {
|
|
94
|
-
// This alternative strategy shouldn't be necessary but sometimes on Windows the file does not get closed,
|
|
95
|
-
// so unzipping it fails, and I don't know why.
|
|
96
94
|
return downloadWin(_url, dest, opts);
|
|
97
95
|
}
|
|
98
96
|
|
|
97
|
+
// Remove auth headers for non-GitHub URLs
|
|
99
98
|
if (opts.headers.authorization && !isGithubUrl(_url)) {
|
|
100
99
|
delete opts.headers.authorization;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
return new Promise((resolve, reject) => {
|
|
104
|
-
console.log(`Download options: ${JSON.stringify(opts)}`);
|
|
105
103
|
const outFile = fs.createWriteStream(dest);
|
|
106
|
-
const mergedOpts = {
|
|
107
|
-
...url.parse(_url),
|
|
108
|
-
...opts,
|
|
109
|
-
};
|
|
110
|
-
https
|
|
111
|
-
.get(mergedOpts, (response) => {
|
|
112
|
-
console.log("statusCode: " + response.statusCode);
|
|
113
|
-
if (response.statusCode === 302) {
|
|
114
|
-
console.log("Following redirect to: " + response.headers.location);
|
|
115
|
-
return download(response.headers.location, dest, opts).then(
|
|
116
|
-
resolve,
|
|
117
|
-
reject
|
|
118
|
-
);
|
|
119
|
-
} else if (response.statusCode !== 200) {
|
|
120
|
-
reject(new Error("Download failed with " + response.statusCode));
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
104
|
+
const mergedOpts = { ...url.parse(_url), ...opts };
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
106
|
+
const request = https.get(mergedOpts, (response) => {
|
|
107
|
+
// Handle redirects
|
|
108
|
+
if (response.statusCode === 302) {
|
|
109
|
+
outFile.destroy();
|
|
110
|
+
return download(response.headers.location, dest, opts).then(resolve, reject);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Handle error status codes
|
|
114
|
+
if (response.statusCode !== 200) {
|
|
115
|
+
outFile.destroy();
|
|
116
|
+
reject(new Error(`Download failed with ${response.statusCode}`));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Pipe the response to file
|
|
121
|
+
response.pipe(outFile);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Handle write stream errors
|
|
125
|
+
outFile.on('error', async (err) => {
|
|
126
|
+
outFile.destroy();
|
|
127
|
+
await fsUnlink(dest).catch(() => { });
|
|
128
|
+
reject(err);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Handle successful completion
|
|
132
|
+
outFile.on('finish', () => {
|
|
133
|
+
outFile.close(() => resolve(null));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Handle request errors
|
|
137
|
+
request.on('error', async (err) => {
|
|
138
|
+
outFile.destroy();
|
|
139
|
+
await fsUnlink(dest).catch(() => { });
|
|
140
|
+
reject(err);
|
|
141
|
+
});
|
|
133
142
|
});
|
|
134
143
|
}
|
|
135
144
|
|
|
@@ -229,6 +238,8 @@ function untar(zipPath, destinationDir) {
|
|
|
229
238
|
if (code !== 0) {
|
|
230
239
|
reject(new Error(`tar xvf exited with ${code}`));
|
|
231
240
|
return;
|
|
241
|
+
} else {
|
|
242
|
+
process.exit(0);
|
|
232
243
|
}
|
|
233
244
|
|
|
234
245
|
resolve();
|
|
@@ -281,7 +292,7 @@ module.exports = async (opts) => {
|
|
|
281
292
|
console.log("Deleting invalid download cache");
|
|
282
293
|
try {
|
|
283
294
|
await fsUnlink(assetDownloadPath);
|
|
284
|
-
} catch (e) {}
|
|
295
|
+
} catch (e) { }
|
|
285
296
|
|
|
286
297
|
throw e;
|
|
287
298
|
}
|
|
@@ -300,7 +311,7 @@ module.exports = async (opts) => {
|
|
|
300
311
|
|
|
301
312
|
try {
|
|
302
313
|
await fsUnlink(assetDownloadPath);
|
|
303
|
-
} catch (e) {}
|
|
314
|
+
} catch (e) { }
|
|
304
315
|
|
|
305
316
|
throw e;
|
|
306
317
|
}
|
package/lib/postinstall.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
// Imports
|
|
4
5
|
const os = require("os");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const path = require("path");
|
|
@@ -19,14 +20,26 @@ if (forceInstall) {
|
|
|
19
20
|
const { VERSION } = require("./constants");
|
|
20
21
|
const BIN_PATH = path.join(__dirname, "../bin");
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
25
|
+
const APP_NAME = "rustywind";
|
|
26
|
+
const REPO = "avencera/rustywind";
|
|
27
|
+
const GITHUB_REPO = `https://github.com/${REPO}`;
|
|
28
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
29
|
+
|
|
22
30
|
process.on("unhandledRejection", (reason, promise) => {
|
|
23
31
|
console.log("Unhandled rejection: ", promise, "reason:", reason);
|
|
24
32
|
});
|
|
25
33
|
|
|
26
34
|
function getTarget() {
|
|
27
|
-
const arch =
|
|
35
|
+
const arch = os.arch();
|
|
36
|
+
const platform = os.platform();
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
console.log(`Downloading: ${APP_NAME}`);
|
|
39
|
+
console.log(` from: ${GITHUB_REPO}`);
|
|
40
|
+
console.log(` for platform: ${arch}-${platform}\n`);
|
|
41
|
+
|
|
42
|
+
switch (platform) {
|
|
30
43
|
case "darwin":
|
|
31
44
|
return arch == "x64" ? "x86_64-apple-darwin" : "aarch64-apple-darwin";
|
|
32
45
|
case "win32":
|
|
@@ -35,12 +48,12 @@ function getTarget() {
|
|
|
35
48
|
return arch === "x64"
|
|
36
49
|
? "x86_64-unknown-linux-musl"
|
|
37
50
|
: arch === "arm"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
? "arm-unknown-linux-gnueabihf"
|
|
52
|
+
: arch === "arm64"
|
|
53
|
+
? "aarch64-unknown-linux-gnu"
|
|
54
|
+
: arch === "ppc64"
|
|
55
|
+
? "powerpc64le-unknown-linux-gnu"
|
|
56
|
+
: "i686-unknown-linux-musl";
|
|
44
57
|
default:
|
|
45
58
|
throw new Error("Unknown platform: " + os.platform());
|
|
46
59
|
}
|
|
@@ -59,6 +72,7 @@ async function main() {
|
|
|
59
72
|
destDir: BIN_PATH,
|
|
60
73
|
force: forceInstall,
|
|
61
74
|
};
|
|
75
|
+
|
|
62
76
|
try {
|
|
63
77
|
await download(opts);
|
|
64
78
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rustywind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
4
|
"description": "CLI for organizing Tailwind CSS classes",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/avencera/rustywind#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"https-proxy-agent": "^
|
|
36
|
+
"https-proxy-agent": "^7.0.6",
|
|
37
37
|
"proxy-from-env": "^1.1.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/release.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/
|
|
3
|
-
"assets_url": "https://api.github.com/repos/avencera/rustywind/releases/
|
|
4
|
-
"upload_url": "https://uploads.github.com/repos/avencera/rustywind/releases/
|
|
5
|
-
"html_url": "https://github.com/avencera/rustywind/releases/tag/v0.
|
|
6
|
-
"id":
|
|
2
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/238338412",
|
|
3
|
+
"assets_url": "https://api.github.com/repos/avencera/rustywind/releases/238338412/assets",
|
|
4
|
+
"upload_url": "https://uploads.github.com/repos/avencera/rustywind/releases/238338412/assets{?name,label}",
|
|
5
|
+
"html_url": "https://github.com/avencera/rustywind/releases/tag/v0.24.1",
|
|
6
|
+
"id": 238338412,
|
|
7
7
|
"author": {
|
|
8
8
|
"login": "github-actions[bot]",
|
|
9
9
|
"id": 41898282,
|
|
@@ -25,20 +25,21 @@
|
|
|
25
25
|
"user_view_type": "public",
|
|
26
26
|
"site_admin": false
|
|
27
27
|
},
|
|
28
|
-
"node_id": "
|
|
29
|
-
"tag_name": "v0.
|
|
28
|
+
"node_id": "RE_kwDODVEYLM4ONMFs",
|
|
29
|
+
"tag_name": "v0.24.1",
|
|
30
30
|
"target_commitish": "master",
|
|
31
|
-
"name": "v0.
|
|
31
|
+
"name": "v0.24.1",
|
|
32
32
|
"draft": false,
|
|
33
|
+
"immutable": false,
|
|
33
34
|
"prerelease": false,
|
|
34
|
-
"created_at": "
|
|
35
|
-
"published_at": "
|
|
35
|
+
"created_at": "2025-08-07T14:39:57Z",
|
|
36
|
+
"published_at": "2025-08-07T14:42:36Z",
|
|
36
37
|
"assets": [
|
|
37
38
|
{
|
|
38
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
39
|
-
"id":
|
|
40
|
-
"node_id": "
|
|
41
|
-
"name": "rustywind-v0.
|
|
39
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301005",
|
|
40
|
+
"id": 280301005,
|
|
41
|
+
"node_id": "RA_kwDODVEYLM4QtQ3N",
|
|
42
|
+
"name": "rustywind-v0.24.1-aarch64-unknown-linux-gnu.tar.gz",
|
|
42
43
|
"label": "",
|
|
43
44
|
"uploader": {
|
|
44
45
|
"login": "github-actions[bot]",
|
|
@@ -63,16 +64,17 @@
|
|
|
63
64
|
},
|
|
64
65
|
"content_type": "application/gzip",
|
|
65
66
|
"state": "uploaded",
|
|
66
|
-
"size":
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
67
|
+
"size": 2127276,
|
|
68
|
+
"digest": "sha256:cc956e522f10408bca77d421973044802cf6fa9b323d91df566596a3682044bc",
|
|
69
|
+
"created_at": "2025-08-07T14:43:22Z",
|
|
70
|
+
"updated_at": "2025-08-07T14:43:23Z",
|
|
71
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-aarch64-unknown-linux-gnu.tar.gz"
|
|
70
72
|
},
|
|
71
73
|
{
|
|
72
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
73
|
-
"id":
|
|
74
|
-
"node_id": "
|
|
75
|
-
"name": "rustywind-v0.
|
|
74
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280300867",
|
|
75
|
+
"id": 280300867,
|
|
76
|
+
"node_id": "RA_kwDODVEYLM4QtQ1D",
|
|
77
|
+
"name": "rustywind-v0.24.1-aarch64-unknown-linux-musl.tar.gz",
|
|
76
78
|
"label": "",
|
|
77
79
|
"uploader": {
|
|
78
80
|
"login": "github-actions[bot]",
|
|
@@ -97,16 +99,17 @@
|
|
|
97
99
|
},
|
|
98
100
|
"content_type": "application/gzip",
|
|
99
101
|
"state": "uploaded",
|
|
100
|
-
"size":
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
102
|
+
"size": 2173594,
|
|
103
|
+
"digest": "sha256:527aefd48f10fe3a5be3646ffe66fe39a64f8a7907b28ac181194188cd830f1f",
|
|
104
|
+
"created_at": "2025-08-07T14:42:37Z",
|
|
105
|
+
"updated_at": "2025-08-07T14:42:37Z",
|
|
106
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-aarch64-unknown-linux-musl.tar.gz"
|
|
104
107
|
},
|
|
105
108
|
{
|
|
106
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
107
|
-
"id":
|
|
108
|
-
"node_id": "
|
|
109
|
-
"name": "rustywind-v0.
|
|
109
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301325",
|
|
110
|
+
"id": 280301325,
|
|
111
|
+
"node_id": "RA_kwDODVEYLM4QtQ8N",
|
|
112
|
+
"name": "rustywind-v0.24.1-arm-unknown-linux-gnueabi.tar.gz",
|
|
110
113
|
"label": "",
|
|
111
114
|
"uploader": {
|
|
112
115
|
"login": "github-actions[bot]",
|
|
@@ -131,16 +134,17 @@
|
|
|
131
134
|
},
|
|
132
135
|
"content_type": "application/gzip",
|
|
133
136
|
"state": "uploaded",
|
|
134
|
-
"size":
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
137
|
+
"size": 2084319,
|
|
138
|
+
"digest": "sha256:dfe3bda998a3f8d3501f18b7d356cd18494ccca3dddd2627979f9e440ea64fe8",
|
|
139
|
+
"created_at": "2025-08-07T14:44:26Z",
|
|
140
|
+
"updated_at": "2025-08-07T14:44:26Z",
|
|
141
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-arm-unknown-linux-gnueabi.tar.gz"
|
|
138
142
|
},
|
|
139
143
|
{
|
|
140
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
141
|
-
"id":
|
|
142
|
-
"node_id": "
|
|
143
|
-
"name": "rustywind-v0.
|
|
144
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301304",
|
|
145
|
+
"id": 280301304,
|
|
146
|
+
"node_id": "RA_kwDODVEYLM4QtQ74",
|
|
147
|
+
"name": "rustywind-v0.24.1-arm-unknown-linux-gnueabihf.tar.gz",
|
|
144
148
|
"label": "",
|
|
145
149
|
"uploader": {
|
|
146
150
|
"login": "github-actions[bot]",
|
|
@@ -165,16 +169,17 @@
|
|
|
165
169
|
},
|
|
166
170
|
"content_type": "application/gzip",
|
|
167
171
|
"state": "uploaded",
|
|
168
|
-
"size":
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
+
"size": 2078301,
|
|
173
|
+
"digest": "sha256:7c4d8de95d53afdd9b0edc608094463ea991e402426cd317aa0fadf6acc03b21",
|
|
174
|
+
"created_at": "2025-08-07T14:44:16Z",
|
|
175
|
+
"updated_at": "2025-08-07T14:44:16Z",
|
|
176
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-arm-unknown-linux-gnueabihf.tar.gz"
|
|
172
177
|
},
|
|
173
178
|
{
|
|
174
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
175
|
-
"id":
|
|
176
|
-
"node_id": "
|
|
177
|
-
"name": "rustywind-v0.
|
|
179
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301349",
|
|
180
|
+
"id": 280301349,
|
|
181
|
+
"node_id": "RA_kwDODVEYLM4QtQ8l",
|
|
182
|
+
"name": "rustywind-v0.24.1-armv7-unknown-linux-gnueabihf.tar.gz",
|
|
178
183
|
"label": "",
|
|
179
184
|
"uploader": {
|
|
180
185
|
"login": "github-actions[bot]",
|
|
@@ -199,50 +204,17 @@
|
|
|
199
204
|
},
|
|
200
205
|
"content_type": "application/gzip",
|
|
201
206
|
"state": "uploaded",
|
|
202
|
-
"size":
|
|
203
|
-
"
|
|
204
|
-
"
|
|
205
|
-
"
|
|
207
|
+
"size": 2061464,
|
|
208
|
+
"digest": "sha256:92c2a3181b311b8b0179bcee402579ce17f2f27c8ccd887ee74073985ec65f98",
|
|
209
|
+
"created_at": "2025-08-07T14:44:32Z",
|
|
210
|
+
"updated_at": "2025-08-07T14:44:32Z",
|
|
211
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-armv7-unknown-linux-gnueabihf.tar.gz"
|
|
206
212
|
},
|
|
207
213
|
{
|
|
208
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
209
|
-
"id":
|
|
210
|
-
"node_id": "
|
|
211
|
-
"name": "rustywind-v0.
|
|
212
|
-
"label": "",
|
|
213
|
-
"uploader": {
|
|
214
|
-
"login": "github-actions[bot]",
|
|
215
|
-
"id": 41898282,
|
|
216
|
-
"node_id": "MDM6Qm90NDE4OTgyODI=",
|
|
217
|
-
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
|
|
218
|
-
"gravatar_id": "",
|
|
219
|
-
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
|
|
220
|
-
"html_url": "https://github.com/apps/github-actions",
|
|
221
|
-
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
|
|
222
|
-
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
|
|
223
|
-
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
|
|
224
|
-
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
|
|
225
|
-
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
|
|
226
|
-
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
|
|
227
|
-
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
|
|
228
|
-
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
229
|
-
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
230
|
-
"type": "Bot",
|
|
231
|
-
"user_view_type": "public",
|
|
232
|
-
"site_admin": false
|
|
233
|
-
},
|
|
234
|
-
"content_type": "application/gzip",
|
|
235
|
-
"state": "uploaded",
|
|
236
|
-
"size": 2074021,
|
|
237
|
-
"created_at": "2024-10-23T02:04:39Z",
|
|
238
|
-
"updated_at": "2024-10-23T02:04:40Z",
|
|
239
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-armv7-unknown-linux-gnueabihf.tar.gz"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067331",
|
|
243
|
-
"id": 201067331,
|
|
244
|
-
"node_id": "RA_kwDODVEYLM4L_AtD",
|
|
245
|
-
"name": "rustywind-v0.23.1-i686-pc-windows-msvc.zip",
|
|
214
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301202",
|
|
215
|
+
"id": 280301202,
|
|
216
|
+
"node_id": "RA_kwDODVEYLM4QtQ6S",
|
|
217
|
+
"name": "rustywind-v0.24.1-i686-pc-windows-msvc.zip",
|
|
246
218
|
"label": "",
|
|
247
219
|
"uploader": {
|
|
248
220
|
"login": "github-actions[bot]",
|
|
@@ -267,50 +239,17 @@
|
|
|
267
239
|
},
|
|
268
240
|
"content_type": "application/zip",
|
|
269
241
|
"state": "uploaded",
|
|
270
|
-
"size":
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
|
|
275
|
-
{
|
|
276
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067055",
|
|
277
|
-
"id": 201067055,
|
|
278
|
-
"node_id": "RA_kwDODVEYLM4L_Aov",
|
|
279
|
-
"name": "rustywind-v0.23.1-i686-unknown-linux-musl.tar.gz",
|
|
280
|
-
"label": "",
|
|
281
|
-
"uploader": {
|
|
282
|
-
"login": "github-actions[bot]",
|
|
283
|
-
"id": 41898282,
|
|
284
|
-
"node_id": "MDM6Qm90NDE4OTgyODI=",
|
|
285
|
-
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
|
|
286
|
-
"gravatar_id": "",
|
|
287
|
-
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
|
|
288
|
-
"html_url": "https://github.com/apps/github-actions",
|
|
289
|
-
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
|
|
290
|
-
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
|
|
291
|
-
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
|
|
292
|
-
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
|
|
293
|
-
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
|
|
294
|
-
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
|
|
295
|
-
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
|
|
296
|
-
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
297
|
-
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
298
|
-
"type": "Bot",
|
|
299
|
-
"user_view_type": "public",
|
|
300
|
-
"site_admin": false
|
|
301
|
-
},
|
|
302
|
-
"content_type": "application/gzip",
|
|
303
|
-
"state": "uploaded",
|
|
304
|
-
"size": 2124948,
|
|
305
|
-
"created_at": "2024-10-23T02:05:00Z",
|
|
306
|
-
"updated_at": "2024-10-23T02:05:00Z",
|
|
307
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-i686-unknown-linux-musl.tar.gz"
|
|
242
|
+
"size": 1741760,
|
|
243
|
+
"digest": "sha256:b7da6cedf73c287bf2cddeff460562cfc418774bc6f089c1612807c87c2e9f80",
|
|
244
|
+
"created_at": "2025-08-07T14:43:58Z",
|
|
245
|
+
"updated_at": "2025-08-07T14:43:59Z",
|
|
246
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-i686-pc-windows-msvc.zip"
|
|
308
247
|
},
|
|
309
248
|
{
|
|
310
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
311
|
-
"id":
|
|
312
|
-
"node_id": "
|
|
313
|
-
"name": "rustywind-v0.
|
|
249
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301589",
|
|
250
|
+
"id": 280301589,
|
|
251
|
+
"node_id": "RA_kwDODVEYLM4QtRAV",
|
|
252
|
+
"name": "rustywind-v0.24.1-i686-unknown-linux-musl.tar.gz",
|
|
314
253
|
"label": "",
|
|
315
254
|
"uploader": {
|
|
316
255
|
"login": "github-actions[bot]",
|
|
@@ -335,16 +274,17 @@
|
|
|
335
274
|
},
|
|
336
275
|
"content_type": "application/gzip",
|
|
337
276
|
"state": "uploaded",
|
|
338
|
-
"size":
|
|
339
|
-
"
|
|
340
|
-
"
|
|
341
|
-
"
|
|
277
|
+
"size": 2132725,
|
|
278
|
+
"digest": "sha256:a6b93676783b30c4f4cffc98f314f09a4eb34df6255bf6f2ff7325fe7065dbbe",
|
|
279
|
+
"created_at": "2025-08-07T14:44:44Z",
|
|
280
|
+
"updated_at": "2025-08-07T14:44:44Z",
|
|
281
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-i686-unknown-linux-musl.tar.gz"
|
|
342
282
|
},
|
|
343
283
|
{
|
|
344
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
345
|
-
"id":
|
|
346
|
-
"node_id": "
|
|
347
|
-
"name": "rustywind-v0.
|
|
284
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301039",
|
|
285
|
+
"id": 280301039,
|
|
286
|
+
"node_id": "RA_kwDODVEYLM4QtQ3v",
|
|
287
|
+
"name": "rustywind-v0.24.1-x86_64-pc-windows-msvc.zip",
|
|
348
288
|
"label": "",
|
|
349
289
|
"uploader": {
|
|
350
290
|
"login": "github-actions[bot]",
|
|
@@ -369,16 +309,17 @@
|
|
|
369
309
|
},
|
|
370
310
|
"content_type": "application/zip",
|
|
371
311
|
"state": "uploaded",
|
|
372
|
-
"size":
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
312
|
+
"size": 2081272,
|
|
313
|
+
"digest": "sha256:7d2be14cf0801e0ae9e6dc097ea28e5003602a834120fd9faab38cc9c039c7b1",
|
|
314
|
+
"created_at": "2025-08-07T14:43:39Z",
|
|
315
|
+
"updated_at": "2025-08-07T14:43:40Z",
|
|
316
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-x86_64-pc-windows-msvc.zip"
|
|
376
317
|
},
|
|
377
318
|
{
|
|
378
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
379
|
-
"id":
|
|
380
|
-
"node_id": "
|
|
381
|
-
"name": "rustywind-v0.
|
|
319
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/280301347",
|
|
320
|
+
"id": 280301347,
|
|
321
|
+
"node_id": "RA_kwDODVEYLM4QtQ8j",
|
|
322
|
+
"name": "rustywind-v0.24.1-x86_64-unknown-linux-musl.tar.gz",
|
|
382
323
|
"label": "",
|
|
383
324
|
"uploader": {
|
|
384
325
|
"login": "github-actions[bot]",
|
|
@@ -403,13 +344,14 @@
|
|
|
403
344
|
},
|
|
404
345
|
"content_type": "application/gzip",
|
|
405
346
|
"state": "uploaded",
|
|
406
|
-
"size":
|
|
407
|
-
"
|
|
408
|
-
"
|
|
409
|
-
"
|
|
347
|
+
"size": 2377182,
|
|
348
|
+
"digest": "sha256:2eea3965332c5f06d588fc3a933d9e9e888fb1ea5c650a34192e5acccd1ce5a5",
|
|
349
|
+
"created_at": "2025-08-07T14:44:31Z",
|
|
350
|
+
"updated_at": "2025-08-07T14:44:32Z",
|
|
351
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.1/rustywind-v0.24.1-x86_64-unknown-linux-musl.tar.gz"
|
|
410
352
|
}
|
|
411
353
|
],
|
|
412
|
-
"tarball_url": "https://api.github.com/repos/avencera/rustywind/tarball/v0.
|
|
413
|
-
"zipball_url": "https://api.github.com/repos/avencera/rustywind/zipball/v0.
|
|
354
|
+
"tarball_url": "https://api.github.com/repos/avencera/rustywind/tarball/v0.24.1",
|
|
355
|
+
"zipball_url": "https://api.github.com/repos/avencera/rustywind/zipball/v0.24.1",
|
|
414
356
|
"body": ""
|
|
415
357
|
}
|
package/lib/install.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const os = require("os");
|
|
3
|
-
const request = require("request");
|
|
4
|
-
const rp = require("request-promise");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const rimraf = require("rimraf");
|
|
7
|
-
const decompress = require("decompress");
|
|
8
|
-
const decompressTargz = require("decompress-targz");
|
|
9
|
-
|
|
10
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
11
|
-
const APP_NAME = "rustywind";
|
|
12
|
-
const REPO = "avencera/rustywind";
|
|
13
|
-
const GITHUB_REPO = `https://github.com/${REPO}`;
|
|
14
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
15
|
-
|
|
16
|
-
const INSTALL_LOCATION = process.cwd();
|
|
17
|
-
|
|
18
|
-
const randomString = () => {
|
|
19
|
-
return Math.random()
|
|
20
|
-
.toString(36)
|
|
21
|
-
.substring(10);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getPlatform = () => {
|
|
25
|
-
switch (os.platform()) {
|
|
26
|
-
case "darwin": {
|
|
27
|
-
return "apple-darwin";
|
|
28
|
-
}
|
|
29
|
-
case "linux": {
|
|
30
|
-
return "unknown-linux-musl";
|
|
31
|
-
}
|
|
32
|
-
case "win32": {
|
|
33
|
-
return "pc-windows-gnu";
|
|
34
|
-
}
|
|
35
|
-
default:
|
|
36
|
-
throw `we don't current support your os (${os.platform()}) please make an issue on github`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const getArch = () => {
|
|
41
|
-
switch (os.arch()) {
|
|
42
|
-
case "x64":
|
|
43
|
-
return "x86_64";
|
|
44
|
-
default:
|
|
45
|
-
throw `we don't current support your cpu arch (${os.arch()}) please make an issue on github`;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
async function getTag(repo) {
|
|
50
|
-
const url = `https://api.github.com/repos/${REPO}/releases/latest`;
|
|
51
|
-
const response = await rp(url, {
|
|
52
|
-
json: true,
|
|
53
|
-
headers: { "user-agent": "node.js" }
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return response.tag_name;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function download() {
|
|
60
|
-
const tag = await getTag(REPO);
|
|
61
|
-
const url = `${GITHUB_REPO}/releases/download/${tag}/${APP_NAME}-${tag}-${getArch()}-${getPlatform()}.tar.gz`;
|
|
62
|
-
|
|
63
|
-
const tmpdir = os.tmpdir();
|
|
64
|
-
|
|
65
|
-
const release = `${tmpdir}/${APP_NAME}-${tag}-${getArch()}-${getPlatform()}-${randomString()}.tar.gz`;
|
|
66
|
-
|
|
67
|
-
console.log(`Downloading: ${APP_NAME}`);
|
|
68
|
-
console.log(`from: ${GITHUB_REPO}`);
|
|
69
|
-
console.log(`version: ${tag}`);
|
|
70
|
-
console.log(`platform: ${getArch()}-${getPlatform()}\n`);
|
|
71
|
-
|
|
72
|
-
/* Create an empty file where we can save data */
|
|
73
|
-
let file = fs.createWriteStream(release);
|
|
74
|
-
/* Using Promises so that we can use the ASYNC AWAIT syntax */
|
|
75
|
-
|
|
76
|
-
await new Promise((resolve, reject) => {
|
|
77
|
-
let stream = request({
|
|
78
|
-
uri: url
|
|
79
|
-
})
|
|
80
|
-
.pipe(file)
|
|
81
|
-
.on("finish", () => {
|
|
82
|
-
console.log("Download complete");
|
|
83
|
-
resolve();
|
|
84
|
-
})
|
|
85
|
-
.on("error", error => {
|
|
86
|
-
reject(error);
|
|
87
|
-
});
|
|
88
|
-
}).catch(error => {
|
|
89
|
-
console.log(`\n ------------- Something happened: ${error} --------- \n`);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
await rimraf.sync(`${INSTALL_LOCATION}/rustywind`);
|
|
93
|
-
|
|
94
|
-
console.log(`Installing to: ${INSTALL_LOCATION}`);
|
|
95
|
-
await decompress(release, INSTALL_LOCATION, {
|
|
96
|
-
plugins: [decompressTargz()]
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
console.log("Installation complete\n");
|
|
100
|
-
|
|
101
|
-
console.log("Cleaning up");
|
|
102
|
-
await rimraf(`${INSTALL_LOCATION}/node_modules`, _ =>
|
|
103
|
-
console.log(`Clean up complete\n`)
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
download();
|