depository-deploy 1.0.4 → 1.0.5

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.
@@ -13,16 +13,45 @@ set -e
13
13
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
14
  DEPLOY_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
15
15
  CONF_FILE="$DEPLOY_DIR/depository.conf"
16
- # Auto-select platform binaries: macos → release/macos/, linux → release/linux/, fallback → release/
16
+ TEMPLATE_DIR="$SCRIPT_DIR/templates"
17
+
18
+ # Resolve release binaries directory:
19
+ # 1. DEPOSITORY_RELEASE_DIR env var (set by wizard-server when launching via web UI)
20
+ # 2. Local release/<platform>/ (deploy:all build)
21
+ # 3. Local release/ (single-platform build)
22
+ # 4. npm sibling package: ../depository-deploy-<platform>/release/<platform>/
17
23
  OS_TYPE="$(uname -s)"
18
- if [ "$OS_TYPE" = "Darwin" ] && [ -d "$DEPLOY_DIR/release/macos" ]; then
19
- RELEASE_DIR="$DEPLOY_DIR/release/macos"
20
- elif [ -d "$DEPLOY_DIR/release/linux" ]; then
21
- RELEASE_DIR="$DEPLOY_DIR/release/linux"
22
- else
23
- RELEASE_DIR="$DEPLOY_DIR/release"
24
+ PLAT_NAME="linux"
25
+ NPM_PKG="depository-deploy-linux"
26
+ if [ "$OS_TYPE" = "Darwin" ]; then
27
+ PLAT_NAME="macos"
28
+ NPM_PKG="depository-deploy-macos"
29
+ fi
30
+
31
+ RELEASE_DIR=""
32
+ if [ -n "$DEPOSITORY_RELEASE_DIR" ] && [ -d "$DEPOSITORY_RELEASE_DIR" ]; then
33
+ # Wizard-server passed resolved path
34
+ if [ -d "$DEPOSITORY_RELEASE_DIR/$PLAT_NAME" ]; then
35
+ RELEASE_DIR="$DEPOSITORY_RELEASE_DIR/$PLAT_NAME"
36
+ else
37
+ RELEASE_DIR="$DEPOSITORY_RELEASE_DIR"
38
+ fi
39
+ fi
40
+ if [ -z "$RELEASE_DIR" ] || [ ! -d "$RELEASE_DIR" ]; then
41
+ if [ -d "$DEPLOY_DIR/release/$PLAT_NAME" ]; then
42
+ RELEASE_DIR="$DEPLOY_DIR/release/$PLAT_NAME"
43
+ elif [ -d "$DEPLOY_DIR/release" ]; then
44
+ RELEASE_DIR="$DEPLOY_DIR/release"
45
+ else
46
+ # Try npm sibling package (global install layout)
47
+ NPM_SIBLING="$(dirname "$DEPLOY_DIR")/$NPM_PKG/release/$PLAT_NAME"
48
+ if [ -d "$NPM_SIBLING" ]; then
49
+ RELEASE_DIR="$NPM_SIBLING"
50
+ else
51
+ RELEASE_DIR="$DEPLOY_DIR/release"
52
+ fi
53
+ fi
24
54
  fi
25
- TEMPLATE_DIR="$SCRIPT_DIR/templates"
26
55
 
27
56
  # ---- Colour helpers ----
28
57
  RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
@@ -13,10 +13,36 @@ $ErrorActionPreference = "Stop"
13
13
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
14
14
  $DeployDir = Split-Path -Parent $ScriptDir
15
15
  $ConfFile = Join-Path $DeployDir "depository.conf"
16
- # Support both flat release/ (single-platform build) and release/windows/ (deploy:all build)
17
- $ReleaseDir = if (Test-Path (Join-Path $DeployDir "release\windows")) { Join-Path $DeployDir "release\windows" } else { Join-Path $DeployDir "release" }
18
16
  $TemplateDir = Join-Path $ScriptDir "templates"
19
17
 
18
+ # Resolve release binaries directory:
19
+ # 1. DEPOSITORY_RELEASE_DIR env var (set by wizard-server when launching via web UI)
20
+ # 2. Local release/windows/ (deploy:all build)
21
+ # 3. Local release/ (single-platform build)
22
+ # 4. npm sibling package: ../depository-deploy-windows/release/windows/
23
+ $ReleaseDir = $null
24
+ if ($env:DEPOSITORY_RELEASE_DIR -and (Test-Path $env:DEPOSITORY_RELEASE_DIR)) {
25
+ # Wizard-server passed resolved path — may point to npm platform package
26
+ $candidate = Join-Path $env:DEPOSITORY_RELEASE_DIR "windows"
27
+ if (Test-Path $candidate) { $ReleaseDir = $candidate }
28
+ else { $ReleaseDir = $env:DEPOSITORY_RELEASE_DIR }
29
+ }
30
+ if (-not $ReleaseDir -or -not (Test-Path $ReleaseDir)) {
31
+ if (Test-Path (Join-Path $DeployDir "release\windows")) {
32
+ $ReleaseDir = Join-Path $DeployDir "release\windows"
33
+ } elseif (Test-Path (Join-Path $DeployDir "release")) {
34
+ $ReleaseDir = Join-Path $DeployDir "release"
35
+ } else {
36
+ # Try npm sibling package (global install layout)
37
+ $npmSibling = Join-Path (Split-Path -Parent $DeployDir) "depository-deploy-windows\release\windows"
38
+ if (Test-Path $npmSibling) {
39
+ $ReleaseDir = $npmSibling
40
+ } else {
41
+ $ReleaseDir = Join-Path $DeployDir "release"
42
+ }
43
+ }
44
+ }
45
+
20
46
  function Write-OK { param($m) Write-Host " [OK] $m" -ForegroundColor Green }
21
47
  function Write-Info { param($m) Write-Host " [INFO] $m" -ForegroundColor Cyan }
22
48
  function Write-Warn { param($m) Write-Host " [WARN] $m" -ForegroundColor Yellow }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "depository-deploy",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Depository document management system – deployment wizard and installers",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -25,9 +25,9 @@
25
25
  "scripts/publish.mjs"
26
26
  ],
27
27
  "optionalDependencies": {
28
- "depository-deploy-linux": "1.0.4",
29
- "depository-deploy-macos": "1.0.4",
30
- "depository-deploy-windows": "1.0.4"
28
+ "depository-deploy-linux": "1.0.5",
29
+ "depository-deploy-macos": "1.0.5",
30
+ "depository-deploy-windows": "1.0.5"
31
31
  },
32
32
  "scripts": {
33
33
  "start": "node wizard-server.mjs"
package/wizard-server.mjs CHANGED
@@ -176,10 +176,11 @@ const server = createServer((req, res) => {
176
176
  const job = { lines: [], done: false, ok: false, subs: new Set() };
177
177
  jobs.set(id, job);
178
178
 
179
- // Spawn installer
179
+ // Spawn installer — pass resolved RELEASE_DIR so scripts find npm platform binaries
180
+ const env = { ...process.env, DEPOSITORY_RELEASE_DIR: RELEASE_DIR };
180
181
  const proc = isWin
181
- ? spawn('powershell', ['-ExecutionPolicy', 'Bypass', '-NonInteractive', '-File', script], { cwd: INSTALL_DIR, shell: false })
182
- : spawn('bash', [script], { cwd: INSTALL_DIR, shell: false });
182
+ ? spawn('powershell', ['-ExecutionPolicy', 'Bypass', '-NonInteractive', '-File', script], { cwd: INSTALL_DIR, shell: false, env })
183
+ : spawn('bash', [script], { cwd: INSTALL_DIR, shell: false, env });
183
184
 
184
185
  function pushLine(raw) {
185
186
  const text = stripAnsi(raw);