ascelerate-skill 0.34.0 → 0.37.0
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/bin/install.js +13 -4
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -7,8 +7,10 @@ const https = require("https");
|
|
|
7
7
|
const readline = require("readline");
|
|
8
8
|
|
|
9
9
|
const home = os.homedir();
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// The skill of this package's release (versioned with ascelerate), else main.
|
|
11
|
+
const version = require("../package.json").version;
|
|
12
|
+
const skillURL = (ref) =>
|
|
13
|
+
`https://raw.githubusercontent.com/keremerkan/ascelerate/${ref}/skills/ascelerate/SKILL.md`;
|
|
12
14
|
|
|
13
15
|
const agents = [
|
|
14
16
|
{
|
|
@@ -133,8 +135,15 @@ async function main() {
|
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
// Fetch latest skill from GitHub
|
|
136
|
-
console.log(
|
|
137
|
-
|
|
138
|
+
console.log(`Fetching the skill for ${version} from GitHub...`);
|
|
139
|
+
let content;
|
|
140
|
+
try {
|
|
141
|
+
content = await fetch(skillURL(`v${version}`));
|
|
142
|
+
} catch (err) {
|
|
143
|
+
if (!/HTTP 404/.test(err.message)) throw err;
|
|
144
|
+
console.log(`No skill at release v${version}; installing the one on main.`);
|
|
145
|
+
content = await fetch(skillURL("main"));
|
|
146
|
+
}
|
|
138
147
|
|
|
139
148
|
fs.mkdirSync(agent.dir, { recursive: true });
|
|
140
149
|
fs.writeFileSync(target, content, "utf8");
|