Skip to content

Commit dd2cb1d

Browse files
chore: adjust install and build release
1 parent 0d01925 commit dd2cb1d

File tree

2 files changed

+42
-23
lines changed

2 files changed

+42
-23
lines changed

scripts/build-binaries.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,18 @@ AGPL-3.0
133133
if (isWindows) {
134134
// Create ZIP for Windows
135135
const zip = new AdmZip();
136-
zip.addLocalFolder(stagingDir);
136+
// Add files with the archive name as the root directory
137+
const files = require('fs').readdirSync(stagingDir);
138+
for (const file of files) {
139+
const filePath = join(stagingDir, file);
140+
const stat = require('fs').statSync(filePath);
141+
142+
if (stat.isDirectory()) {
143+
zip.addLocalFolder(filePath, `${archiveName}/${file}`);
144+
} else {
145+
zip.addLocalFile(filePath, archiveName);
146+
}
147+
}
137148
const zipPath = join(binariesDir, `${archiveName}.zip`);
138149
zip.writeZip(zipPath);
139150
console.log(`✅ Created: ${archiveName}.zip`);

scripts/install.sh

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -327,30 +327,38 @@ verify_installation() {
327327

328328
# Test mimir init in a temporary directory
329329
local test_dir=$(mktemp -d)
330-
(
331-
cd "$test_dir"
332-
print_info "Testing mimir init in: $test_dir"
333-
334-
# Run init with quiet flag (output to variable to capture errors)
335-
init_output=$(timeout 30s mimir init --no-interactive --quiet 2>&1)
336-
init_exit_code=$?
337-
338-
if [ $init_exit_code -ne 0 ]; then
339-
print_error "mimir init failed with exit code $init_exit_code"
340-
echo "$init_output"
341-
rm -rf "$test_dir"
342-
return 1
343-
fi
330+
print_info "Testing mimir init in: $test_dir"
344331

345-
if [ ! -d ".mimir" ] || [ ! -f ".mimir/config.yml" ]; then
346-
print_error ".mimir directory or config.yml not created"
347-
ls -la
348-
rm -rf "$test_dir"
349-
return 1
350-
fi
332+
# Save current directory and change to test directory
333+
local original_dir=$(pwd)
334+
cd "$test_dir" || {
335+
print_error "Failed to change to test directory"
336+
rm -rf "$test_dir"
337+
return 1
338+
}
339+
340+
# Run init with quiet flag (output to variable to capture errors)
341+
init_output=$(timeout 30s mimir init --no-interactive --quiet 2>&1)
342+
init_exit_code=$?
343+
344+
if [ $init_exit_code -ne 0 ]; then
345+
print_error "mimir init failed with exit code $init_exit_code"
346+
echo "$init_output"
347+
cd "$original_dir"
348+
rm -rf "$test_dir"
349+
return 1
350+
fi
351+
352+
if [ ! -d ".mimir" ] || [ ! -f ".mimir/config.yml" ]; then
353+
print_error ".mimir directory or config.yml not created"
354+
ls -la
355+
cd "$original_dir"
356+
rm -rf "$test_dir"
357+
return 1
358+
fi
351359

352-
print_success "mimir init works correctly"
353-
)
360+
print_success "mimir init works correctly"
361+
cd "$original_dir"
354362
rm -rf "$test_dir"
355363

356364
# Test mimir doctor

0 commit comments

Comments
 (0)