depository-deploy 1.0.4 → 1.0.6
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/install-unix.sh +37 -8
- package/install/install-windows.ps1 +28 -2
- package/package.json +4 -4
- package/scripts/publish.mjs +2 -2
- package/wizard-server.mjs +4 -3
package/install/install-unix.sh
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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.
|
|
3
|
+
"version": "1.0.6",
|
|
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.
|
|
29
|
-
"depository-deploy-macos": "1.0.
|
|
30
|
-
"depository-deploy-windows": "1.0.
|
|
28
|
+
"depository-deploy-linux": ">=1.0.0",
|
|
29
|
+
"depository-deploy-macos": ">=1.0.0",
|
|
30
|
+
"depository-deploy-windows": ">=1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"start": "node wizard-server.mjs"
|
package/scripts/publish.mjs
CHANGED
|
@@ -199,8 +199,8 @@ async function main() {
|
|
|
199
199
|
if (newVersion !== currentVersion) {
|
|
200
200
|
pkg.version = newVersion;
|
|
201
201
|
}
|
|
202
|
-
// Sync optionalDependencies versions
|
|
203
|
-
if (pkg.optionalDependencies) {
|
|
202
|
+
// Sync optionalDependencies versions (only when platform packages are also published)
|
|
203
|
+
if (!wizardOnly && pkg.optionalDependencies) {
|
|
204
204
|
for (const plat of PLATFORMS) {
|
|
205
205
|
if (pkg.optionalDependencies[plat.pkgName]) {
|
|
206
206
|
pkg.optionalDependencies[plat.pkgName] = newVersion;
|
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);
|