Skip to content

Commit 77771ee

Browse files
author
Michael Taylor
committed
0.4.9
1 parent da5a825 commit 77771ee

File tree

10 files changed

+1076
-78
lines changed

10 files changed

+1076
-78
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "digstore_min"
3-
version = "0.4.8"
3+
version = "0.4.9"
44
edition = "2021"
55
rust-version = "1.70"
66
authors = ["DIG Network"]

INSTALL.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Digstore Installation
2+
3+
## Quick Install (Recommended)
4+
5+
### Windows
6+
```powershell
7+
# Run in PowerShell as Administrator
8+
iex (iwr -Uri "https://raw.githubusercontent.com/DIG-Network/digstore/main/install.ps1").Content
9+
```
10+
11+
### Linux/macOS
12+
```bash
13+
# Run in terminal
14+
curl -fsSL https://raw.githubusercontent.com/DIG-Network/digstore/main/install.sh | bash
15+
```
16+
17+
## What the Bootstrap Installer Does
18+
19+
1. **Downloads** the latest digstore binary for your platform
20+
2. **Installs** to versioned directory structure:
21+
- Windows: `C:\Program Files (x86)\dig-network\v0.4.7\digstore.exe`
22+
- macOS: `/usr/local/lib/digstore/v0.4.7/digstore`
23+
- Linux: `/usr/local/lib/digstore/v0.4.7/digstore`
24+
3. **Updates PATH** to point to the installed version
25+
4. **Sets up version management** for future updates
26+
27+
## After Installation
28+
29+
Once installed, you can manage versions like nvm:
30+
31+
```bash
32+
# Check current version
33+
digstore --version
34+
35+
# List installed versions
36+
digstore version list
37+
38+
# Install specific version
39+
digstore version install-version 0.4.8
40+
41+
# Switch between versions
42+
digstore version set 0.4.7
43+
digstore version set 0.4.8
44+
45+
# Update to latest
46+
digstore update
47+
48+
# Fix PATH conflicts
49+
digstore version fix-path-auto
50+
```
51+
52+
## Manual Installation
53+
54+
If you prefer manual installation:
55+
56+
### Windows
57+
1. Download [digstore-windows-x64.msi](https://github.com/DIG-Network/digstore/releases/latest/download/digstore-windows-x64.msi)
58+
2. Run: `digstore version install-msi digstore-windows-x64.msi`
59+
3. Run: `digstore version fix-path-auto`
60+
61+
### macOS
62+
1. Download [digstore-macos.dmg](https://github.com/DIG-Network/digstore/releases/latest/download/digstore-macos.dmg)
63+
2. Run: `digstore version install-msi digstore-macos.dmg`
64+
3. Run: `digstore version fix-path-auto`
65+
66+
### Linux
67+
1. Download [digstore-linux-x86_64.AppImage](https://github.com/DIG-Network/digstore/releases/latest/download/digstore-linux-x86_64.AppImage)
68+
2. Run: `digstore version install-msi digstore-linux-x86_64.AppImage`
69+
3. Run: `digstore version fix-path-auto`
70+
71+
## Build from Source
72+
73+
```bash
74+
# Install Rust
75+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
76+
77+
# Clone and build
78+
git clone https://github.com/DIG-Network/digstore.git
79+
cd digstore
80+
cargo build --release
81+
82+
# Install with version management
83+
./target/release/digstore version install-current
84+
./target/release/digstore version fix-path-auto
85+
```
86+
87+
## Troubleshooting
88+
89+
### Permission Issues
90+
- **Windows**: Run PowerShell as Administrator
91+
- **Linux/macOS**: Ensure you have sudo access
92+
93+
### PATH Issues
94+
```bash
95+
digstore version fix-path # Analyze PATH conflicts
96+
digstore version fix-path-auto # Automatically fix PATH
97+
```
98+
99+
### Version Conflicts
100+
```bash
101+
digstore version list # See installed versions
102+
digstore version set <version> # Switch to specific version
103+
digstore version remove <version> # Remove old versions
104+
```

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
Complete command reference for Digstore - a content-addressable storage system with Git-like semantics.
44

5+
## Installation
6+
7+
### Quick Install
8+
```bash
9+
# Windows (PowerShell as Administrator)
10+
iex (iwr -Uri "https://raw.githubusercontent.com/DIG-Network/digstore/main/install.ps1").Content
11+
12+
# Linux/macOS
13+
curl -fsSL https://raw.githubusercontent.com/DIG-Network/digstore/main/install.sh | bash
14+
```
15+
16+
See [INSTALL.md](INSTALL.md) for detailed installation instructions.
17+
518
## Quick Start
619

720
```bash
@@ -259,6 +272,7 @@ digstore version list-system # System-installed versions
259272
# Install and manage versions
260273
digstore version install-current # Install current binary
261274
digstore version install-msi installer.msi # Install from MSI
275+
digstore version install-version 0.4.8 # Install specific version from GitHub
262276
digstore version set 0.4.5 # Set active version
263277
digstore version remove 0.4.3 # Remove version
264278

@@ -273,6 +287,7 @@ digstore version fix-path-auto # Auto-fix PATH ordering
273287
- `list-system` - List system-installed versions
274288
- `install-current` - Install currently running binary
275289
- `install-msi <PATH>` - Install from MSI file
290+
- `install-version <VERSION>` - Install specific version from GitHub
276291
- `set <VERSION>` - Set active version
277292
- `remove <VERSION>` - Remove a version
278293
- `update-path <VERSION>` - Update PATH for version

install.ps1

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Digstore Bootstrap Installer
2+
# This script downloads and installs the latest version of Digstore with version management
3+
4+
param(
5+
[string]$Version = "latest",
6+
[switch]$Force = $false
7+
)
8+
9+
$ErrorActionPreference = "Stop"
10+
11+
Write-Host "🚀 Digstore Bootstrap Installer" -ForegroundColor Cyan
12+
Write-Host "=================================" -ForegroundColor Cyan
13+
Write-Host ""
14+
15+
# Determine installation directory
16+
$ProgramFiles = $env:ProgramFiles
17+
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64" -and $env:ProgramW6432) {
18+
$ProgramFiles = ${env:ProgramFiles(x86)}
19+
}
20+
$InstallBase = Join-Path $ProgramFiles "dig-network"
21+
$VersionDir = Join-Path $InstallBase "v$Version"
22+
23+
Write-Host "Installing to: $VersionDir" -ForegroundColor Green
24+
25+
# Check if already installed
26+
if (Test-Path $VersionDir -and -not $Force) {
27+
Write-Host "Version $Version is already installed at: $VersionDir" -ForegroundColor Yellow
28+
Write-Host "Use -Force to reinstall" -ForegroundColor Yellow
29+
exit 0
30+
}
31+
32+
# Create directories
33+
Write-Host "Creating installation directory..." -ForegroundColor Blue
34+
try {
35+
New-Item -ItemType Directory -Path $VersionDir -Force | Out-Null
36+
} catch {
37+
Write-Host "❌ Failed to create directory: $VersionDir" -ForegroundColor Red
38+
Write-Host "This script requires administrator privileges to install to Program Files." -ForegroundColor Red
39+
Write-Host "Please run as administrator or install to user directory manually." -ForegroundColor Red
40+
exit 1
41+
}
42+
43+
# Download the latest MSI
44+
$DownloadUrl = "https://github.com/DIG-Network/digstore/releases/latest/download/digstore-windows-x64.msi"
45+
if ($Version -ne "latest") {
46+
$DownloadUrl = "https://github.com/DIG-Network/digstore/releases/download/v$Version/digstore-windows-x64.msi"
47+
}
48+
49+
$TempMsi = Join-Path $env:TEMP "digstore-installer.msi"
50+
51+
Write-Host "Downloading from: $DownloadUrl" -ForegroundColor Blue
52+
try {
53+
Invoke-WebRequest -Uri $DownloadUrl -OutFile $TempMsi -UserAgent "Digstore-Bootstrap"
54+
Write-Host "✅ Download completed" -ForegroundColor Green
55+
} catch {
56+
Write-Host "❌ Download failed: $($_.Exception.Message)" -ForegroundColor Red
57+
exit 1
58+
}
59+
60+
# Install MSI to system location
61+
Write-Host "Installing MSI..." -ForegroundColor Blue
62+
try {
63+
$InstallArgs = @("/i", $TempMsi, "/quiet", "/norestart")
64+
$Process = Start-Process "msiexec" -ArgumentList $InstallArgs -Wait -PassThru
65+
66+
if ($Process.ExitCode -ne 0) {
67+
throw "MSI installation failed with exit code: $($Process.ExitCode)"
68+
}
69+
70+
Write-Host "✅ MSI installation completed" -ForegroundColor Green
71+
} catch {
72+
Write-Host "❌ Installation failed: $($_.Exception.Message)" -ForegroundColor Red
73+
Remove-Item $TempMsi -ErrorAction SilentlyContinue
74+
exit 1
75+
}
76+
77+
# Wait for installation to complete
78+
Start-Sleep -Seconds 2
79+
80+
# Move installed files to versioned directory
81+
Write-Host "Organizing into versioned directory..." -ForegroundColor Blue
82+
$SourceBinary = Join-Path $InstallBase "digstore.exe"
83+
$TargetBinary = Join-Path $VersionDir "digstore.exe"
84+
85+
if (Test-Path $SourceBinary) {
86+
# Move binary to versioned directory
87+
Move-Item $SourceBinary $TargetBinary -Force
88+
89+
# Move any other files
90+
Get-ChildItem $InstallBase -File | ForEach-Object {
91+
$TargetPath = Join-Path $VersionDir $_.Name
92+
Move-Item $_.FullName $TargetPath -Force -ErrorAction SilentlyContinue
93+
}
94+
95+
Write-Host "✅ Files organized into versioned directory" -ForegroundColor Green
96+
} else {
97+
Write-Host "❌ Binary not found at expected location: $SourceBinary" -ForegroundColor Red
98+
Remove-Item $TempMsi -ErrorAction SilentlyContinue
99+
exit 1
100+
}
101+
102+
# Update PATH
103+
Write-Host "Updating PATH..." -ForegroundColor Blue
104+
try {
105+
# Get current PATH
106+
$CurrentPath = [Environment]::GetEnvironmentVariable("PATH", "User")
107+
108+
# Remove any existing dig-network entries
109+
$PathEntries = $CurrentPath -split ";" | Where-Object { $_ -and -not $_.StartsWith($InstallBase) }
110+
111+
# Add new version directory to front
112+
$NewPath = "$VersionDir;" + ($PathEntries -join ";")
113+
114+
# Update PATH
115+
[Environment]::SetEnvironmentVariable("PATH", $NewPath, "User")
116+
$env:PATH = $NewPath
117+
118+
Write-Host "✅ PATH updated to use version $Version" -ForegroundColor Green
119+
} catch {
120+
Write-Host "⚠️ Could not update PATH automatically: $($_.Exception.Message)" -ForegroundColor Yellow
121+
Write-Host "Please manually add to your PATH: $VersionDir" -ForegroundColor Yellow
122+
}
123+
124+
# Save active version
125+
$ActiveFile = Join-Path $InstallBase "active"
126+
Set-Content -Path $ActiveFile -Value $Version -Force
127+
128+
# Clean up
129+
Remove-Item $TempMsi -ErrorAction SilentlyContinue
130+
131+
Write-Host ""
132+
Write-Host "🎉 Digstore $Version installed successfully!" -ForegroundColor Green
133+
Write-Host "Location: $VersionDir" -ForegroundColor Cyan
134+
Write-Host ""
135+
Write-Host "Usage:" -ForegroundColor Yellow
136+
Write-Host " digstore --version # Check installed version"
137+
Write-Host " digstore init # Initialize a repository"
138+
Write-Host " digstore version list # List installed versions"
139+
Write-Host " digstore version install-version 0.4.8 # Install specific version"
140+
Write-Host " digstore version set 0.4.8 # Switch to version"
141+
Write-Host " digstore update # Update to latest"
142+
Write-Host ""
143+
Write-Host "For help: digstore --help" -ForegroundColor Cyan
144+
Write-Host ""
145+
Write-Host "⚠️ Restart your terminal to use the new PATH" -ForegroundColor Yellow

0 commit comments

Comments
 (0)