feat(spotify): implement milestone M1 scaffold
This commit is contained in:
9
skills/spotify/scripts/setup.sh
Executable file
9
skills/spotify/scripts/setup.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SKILL_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
|
||||
cd "${SKILL_DIR}"
|
||||
npm install
|
||||
scripts/spotify auth
|
||||
26
skills/spotify/scripts/spotify
Executable file
26
skills/spotify/scripts/spotify
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { existsSync } from "node:fs";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { spawnSync } from "node:child_process";
|
||||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const skillDir = resolve(scriptDir, "..");
|
||||
const tsxBin = join(skillDir, "node_modules", ".bin", "tsx");
|
||||
|
||||
if (!existsSync(tsxBin)) {
|
||||
process.stderr.write(`Missing local Node dependencies for spotify. Run 'cd ${skillDir} && npm install' first.\n`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const result = spawnSync(process.execPath, [tsxBin, join(skillDir, "src", "cli.ts"), ...process.argv.slice(2)], {
|
||||
stdio: "inherit"
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
process.stderr.write(`${result.error.message}\n`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(typeof result.status === "number" ? result.status : 1);
|
||||
Reference in New Issue
Block a user