@plusonelabs/cue 0.0.10 → 0.0.13

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 CHANGED
@@ -1,47 +1,63 @@
1
1
  #!/bin/bash
2
2
  echo "Installing Cue CLI..."
3
3
 
4
- # Prefer local installation for auto-update support
5
4
  # Check if --global flag is explicitly passed
6
5
  if [[ "$1" == "--global" ]]; then
7
- if command -v sudo >/dev/null 2>&1 && ([ -w /usr/local/bin ] || sudo -n true 2>/dev/null); then
8
- echo "Installing globally (requires sudo)..."
9
- sudo mkdir -p /usr/local/bin
10
- sudo cp dist/cli.mjs /usr/local/bin/cue.mjs
11
- sudo chmod +x /usr/local/bin/cue.mjs
12
- # Create wrapper script
13
- sudo tee /usr/local/bin/cue > /dev/null << 'WRAPPER'
6
+ echo "Installing globally via npm..."
7
+ npm install -g @plusonelabs/cue
8
+ echo "Cue CLI installed globally!"
9
+ echo "Run 'cue' from anywhere."
10
+ echo ""
11
+ echo "To update: npm update -g @plusonelabs/cue"
12
+ else
13
+ echo "Installing locally to ~/.cue/local (recommended for auto-updates)..."
14
+
15
+ # Create local installation directory
16
+ LOCAL_DIR="$HOME/.cue/local"
17
+ mkdir -p "$LOCAL_DIR"
18
+
19
+ # Create or update package.json
20
+ if [ ! -f "$LOCAL_DIR/package.json" ]; then
21
+ cat > "$LOCAL_DIR/package.json" << 'PACKAGE'
22
+ {
23
+ "name": "cue-local",
24
+ "version": "0.0.1",
25
+ "private": true,
26
+ "dependencies": {}
27
+ }
28
+ PACKAGE
29
+ fi
30
+
31
+ # Install or update the package
32
+ cd "$LOCAL_DIR"
33
+ npm install @plusonelabs/cue@latest --save
34
+
35
+ # Create wrapper script
36
+ cat > "$LOCAL_DIR/cue" << 'WRAPPER'
14
37
  #!/bin/bash
15
- exec node /usr/local/bin/cue.mjs "$@"
38
+ exec "$HOME/.cue/local/node_modules/.bin/cue" "$@"
16
39
  WRAPPER
17
- sudo chmod +x /usr/local/bin/cue
18
- echo "Cue CLI installed globally!"
40
+ chmod +x "$LOCAL_DIR/cue"
41
+
42
+ # Create symlink in /usr/local/bin if possible
43
+ if [ -w /usr/local/bin ]; then
44
+ ln -sf "$LOCAL_DIR/cue" /usr/local/bin/cue
45
+ echo "Cue CLI installed! Symlink created at /usr/local/bin/cue"
19
46
  echo "Run 'cue' from anywhere."
20
- echo ""
21
- echo "Note: Global installation prevents auto-updates due to permission requirements."
22
47
  else
23
- echo "Error: Global installation requires sudo access."
24
- echo "Try: ./install.sh (for local install with auto-update support)"
25
- exit 1
48
+ echo "Cue CLI installed to ~/.cue/local/cue"
49
+ echo ""
50
+ echo "To use globally, either:"
51
+ echo "1. Add ~/.cue/local to your PATH:"
52
+ echo " export PATH=\"\$HOME/.cue/local:\$PATH\""
53
+ echo " # Add the above line to ~/.bashrc or ~/.zshrc"
54
+ echo ""
55
+ echo "2. Or create a symlink (requires sudo):"
56
+ echo " sudo ln -sf $LOCAL_DIR/cue /usr/local/bin/cue"
57
+ echo ""
58
+ echo "Or run directly: ~/.cue/local/cue"
26
59
  fi
27
- else
28
- echo "Installing locally to ~/bin (recommended for auto-updates)..."
29
- mkdir -p ~/bin
30
- cp dist/cli.mjs ~/bin/cue.mjs
31
- chmod +x ~/bin/cue.mjs
32
- # Create wrapper script
33
- cat > ~/bin/cue << 'WRAPPER'
34
- #!/bin/bash
35
- exec node ~/bin/cue.mjs "$@"
36
- WRAPPER
37
- chmod +x ~/bin/cue
38
- echo "Cue CLI installed to ~/bin/cue"
39
- echo ""
40
- echo "To use globally, add ~/bin to your PATH:"
41
- echo " export PATH=\"\$HOME/bin:\$PATH\""
42
- echo " # Add the above line to ~/.bashrc or ~/.zshrc to make it permanent"
43
- echo ""
44
- echo "Or run directly: ~/bin/cue"
60
+
45
61
  echo ""
46
- echo "Auto-updates will work with this installation method."
62
+ echo "Auto-update with: cue update"
47
63
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusonelabs/cue",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "Cue CLI",
5
5
  "main": "./dist/cli.mjs",
6
6
  "bin": {
Binary file