caflip 0.2.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/install.sh ADDED
@@ -0,0 +1,47 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ REPO="LucienLee/caflip"
5
+ BINARY="caflip"
6
+ INSTALL_DIR="/usr/local/bin"
7
+
8
+ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
9
+ ARCH=$(uname -m)
10
+
11
+ case "$OS" in
12
+ darwin|linux) ;;
13
+ *)
14
+ echo "Error: unsupported OS '$OS'. Only macOS and Linux are supported." >&2
15
+ exit 1
16
+ ;;
17
+ esac
18
+
19
+ case "$ARCH" in
20
+ aarch64|arm64) ARCH="arm64" ;;
21
+ x86_64) ARCH="x64" ;;
22
+ *)
23
+ echo "Error: unsupported architecture '$ARCH'." >&2
24
+ exit 1
25
+ ;;
26
+ esac
27
+
28
+ URL="https://github.com/${REPO}/releases/latest/download/${BINARY}-${OS}-${ARCH}"
29
+ TMPFILE=$(mktemp)
30
+
31
+ echo "Downloading ${BINARY} for ${OS}/${ARCH}..."
32
+ if ! curl -fSL -o "$TMPFILE" "$URL"; then
33
+ rm -f "$TMPFILE"
34
+ echo "Error: download failed. Check that a release exists for ${OS}-${ARCH}." >&2
35
+ exit 1
36
+ fi
37
+
38
+ chmod +x "$TMPFILE"
39
+
40
+ if [ -w "$INSTALL_DIR" ]; then
41
+ mv "$TMPFILE" "${INSTALL_DIR}/${BINARY}"
42
+ else
43
+ echo "Need sudo to install to ${INSTALL_DIR}"
44
+ sudo mv "$TMPFILE" "${INSTALL_DIR}/${BINARY}"
45
+ fi
46
+
47
+ echo "Installed ${BINARY} to ${INSTALL_DIR}/${BINARY}"
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "caflip",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "caflip": "bin/caflip"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "dist",
11
+ "README.md",
12
+ "install.sh"
13
+ ],
14
+ "scripts": {
15
+ "build": "bun build --compile src/index.ts --outfile caflip",
16
+ "buildjs": "bun build src/index.ts --target=node --outfile dist/cli.js",
17
+ "dev": "bun run src/index.ts",
18
+ "prepublishOnly": "bun test && bun run buildjs",
19
+ "start": "bun run src/index.ts",
20
+ "test": "bun test"
21
+ },
22
+ "devDependencies": {
23
+ "@types/bun": "latest"
24
+ },
25
+ "peerDependencies": {
26
+ "typescript": "^5"
27
+ },
28
+ "dependencies": {
29
+ "@inquirer/prompts": "^8.2.1"
30
+ }
31
+ }