get-shit-done-cc-ui 0.2.7 → 0.2.8
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/get-shit-done-cc-ui +15 -8
- package/bin/get-shit-done-cc-ui.cmd +12 -6
- package/lib/download.js +3 -2
- package/package.json +1 -1
package/bin/get-shit-done-cc-ui
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
|
-
#
|
|
3
|
-
|
|
2
|
+
# Use persistent cache directory (survives npx temp cleanup)
|
|
3
|
+
CACHE_DIR="${HOME}/.cache/get-shit-done-cc-ui"
|
|
4
|
+
BINARY="$CACHE_DIR/gsd-ui-web"
|
|
4
5
|
|
|
5
|
-
#
|
|
6
|
+
# Resolve package directory for download script
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
PACKAGE_DIR="$(dirname "$SCRIPT_DIR")"
|
|
9
|
+
|
|
10
|
+
# If we're in .bin symlink, find actual package
|
|
6
11
|
if echo "$PACKAGE_DIR" | grep -q "node_modules$"; then
|
|
7
12
|
PACKAGE_DIR="$PACKAGE_DIR/get-shit-done-cc-ui"
|
|
8
13
|
fi
|
|
9
14
|
|
|
10
|
-
BINARY="$PACKAGE_DIR/bin/gsd-ui-web"
|
|
11
15
|
DOWNLOAD_SCRIPT="$PACKAGE_DIR/lib/download.js"
|
|
12
16
|
|
|
13
|
-
#
|
|
17
|
+
# Create cache directory
|
|
18
|
+
mkdir -p "$CACHE_DIR"
|
|
19
|
+
|
|
20
|
+
# Check if binary exists in cache
|
|
14
21
|
if [ ! -f "$BINARY" ]; then
|
|
15
22
|
echo "Binary not found. Downloading for your platform..."
|
|
23
|
+
# Set cache dir for download script
|
|
24
|
+
export GSD_CACHE_DIR="$CACHE_DIR"
|
|
16
25
|
node "$DOWNLOAD_SCRIPT"
|
|
17
26
|
DOWNLOAD_EXIT=$?
|
|
18
27
|
if [ $DOWNLOAD_EXIT -ne 0 ]; then
|
|
19
28
|
exit $DOWNLOAD_EXIT
|
|
20
29
|
fi
|
|
21
|
-
echo ""
|
|
22
|
-
echo "Download complete! Run 'npx get-shit-done-cc-ui' again to start."
|
|
23
|
-
exit 0
|
|
24
30
|
fi
|
|
25
31
|
|
|
32
|
+
# Run the binary
|
|
26
33
|
exec "$BINARY" "$@"
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
@echo off
|
|
2
2
|
setlocal
|
|
3
3
|
|
|
4
|
-
::
|
|
4
|
+
:: Use persistent cache directory
|
|
5
|
+
set "CACHE_DIR=%USERPROFILE%\.cache\get-shit-done-cc-ui"
|
|
6
|
+
set "BINARY=%CACHE_DIR%\gsd-ui-web.exe"
|
|
7
|
+
|
|
8
|
+
:: Find package directory for download script
|
|
5
9
|
set "SCRIPT_DIR=%~dp0"
|
|
6
10
|
set "PACKAGE_DIR=%SCRIPT_DIR%.."
|
|
7
11
|
|
|
8
|
-
:: If
|
|
12
|
+
:: If in node_modules/.bin, find actual package
|
|
9
13
|
if exist "%PACKAGE_DIR%\get-shit-done-cc-ui\package.json" (
|
|
10
14
|
set "PACKAGE_DIR=%PACKAGE_DIR%\get-shit-done-cc-ui"
|
|
11
15
|
)
|
|
12
16
|
|
|
13
|
-
set "BINARY=%PACKAGE_DIR%\bin\gsd-ui-web.exe"
|
|
14
17
|
set "DOWNLOAD_SCRIPT=%PACKAGE_DIR%\lib\download.js"
|
|
15
18
|
|
|
19
|
+
:: Create cache directory
|
|
20
|
+
if not exist "%CACHE_DIR%" mkdir "%CACHE_DIR%"
|
|
21
|
+
|
|
22
|
+
:: Check if binary exists in cache
|
|
16
23
|
if not exist "%BINARY%" (
|
|
17
24
|
echo Binary not found. Downloading for your platform...
|
|
25
|
+
set "GSD_CACHE_DIR=%CACHE_DIR%"
|
|
18
26
|
node "%DOWNLOAD_SCRIPT%"
|
|
19
27
|
if errorlevel 1 exit /b 1
|
|
20
|
-
echo.
|
|
21
|
-
echo Download complete! Run 'npx get-shit-done-cc-ui' again to start.
|
|
22
|
-
exit /b 0
|
|
23
28
|
)
|
|
24
29
|
|
|
30
|
+
:: Run the binary
|
|
25
31
|
"%BINARY%" %*
|
package/lib/download.js
CHANGED
|
@@ -181,10 +181,11 @@ async function downloadBinary() {
|
|
|
181
181
|
const isWindows = binaryName.endsWith('.exe');
|
|
182
182
|
const outputName = isWindows ? 'gsd-ui-web.exe' : 'gsd-ui-web';
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
// Use cache directory if set (for npx persistence), otherwise package bin
|
|
185
|
+
const binDir = process.env.GSD_CACHE_DIR || path.join(__dirname, '..', 'bin');
|
|
185
186
|
const binaryPath = path.join(binDir, outputName);
|
|
186
187
|
|
|
187
|
-
// Ensure
|
|
188
|
+
// Ensure directory exists
|
|
188
189
|
if (!fs.existsSync(binDir)) {
|
|
189
190
|
fs.mkdirSync(binDir, { recursive: true });
|
|
190
191
|
}
|