Skip to content

Commit ace2fd3

Browse files
Merge pull request #5 from raythurman2386/fix-install-errors
fix: improve installation robustness and build portability
2 parents 3617a35 + 59767d5 commit ace2fd3

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.1.4-beta] - 2026-02-25
9+
10+
### Fixed
11+
- **Installation**: Improved script robustness with dependency checks for `curl`, `wget`, and `tar`.
12+
- **Portability**: Added OS and `systemctl` checks to installation scripts to prevent failures on non-systemd/non-Linux systems.
13+
- **Build**: Set `CGO_ENABLED=0` in Makefile to ensure portability and fix build errors in environments without C headers.
14+
- **Documentation**: Corrected documentation URL in systemd service file.
915

1016
### Added
1117
- **Themes**: New "Ravenwood" and "Nord" color schemes.
@@ -37,5 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3743
- **Installer**: One-liner install script for downloading pre-built binaries from GitHub releases.
3844
- **Packaging**: DEB, RPM, APK, and Arch Linux packages via GoReleaser.
3945

40-
[Unreleased]: https://github.com/raythurman2386/straw/compare/v0.1.0-beta...HEAD
46+
[Unreleased]: https://github.com/raythurman2386/straw/compare/v0.1.4-beta...HEAD
47+
[0.1.4-beta]: https://github.com/raythurman2386/straw/compare/v0.1.3-beta...v0.1.4-beta
4148
[0.1.0-beta]: https://github.com/raythurman2386/straw/releases/tag/v0.1.0-beta

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
PREFIX ?= /usr/local
44
BINDIR = $(PREFIX)/bin
55
GO ?= go
6+
export CGO_ENABLED ?= 0
67

78
# Attempt to find golangci-lint
89
LINTER := $(shell which golangci-lint 2> /dev/null || which $(HOME)/go/bin/golangci-lint 2> /dev/null || echo "golangci-lint")

install.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ set -e
77
REPO="raythurman2386/straw"
88
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
99

10+
# Check for dependencies
11+
if ! command -v curl >/dev/null 2>&1 && ! command -v wget >/dev/null 2>&1; then
12+
echo "Error: curl or wget is required to run this script."
13+
exit 1
14+
fi
15+
16+
if ! command -v tar >/dev/null 2>&1; then
17+
echo "Error: tar is required to extract the binaries."
18+
exit 1
19+
fi
20+
1021
# Detect OS
1122
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1223
ARCH=$(uname -m)

scripts/install-from-source.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ make build
4040
echo "Step 3: Installing binaries to /usr/local/bin (requires sudo)..."
4141
sudo make install
4242

43-
# 4. Install the background service
44-
echo "Step 4: Installing the background daemon service..."
45-
"$SCRIPT_DIR/install_service.sh"
43+
# 4. Install the background service (Linux only)
44+
if [ "$(uname -s)" = "Linux" ]; then
45+
echo "Step 4: Installing the background daemon service..."
46+
"$SCRIPT_DIR/install_service.sh"
47+
else
48+
echo "Step 4: Skipping background service installation (not supported on this OS)."
49+
echo "You can run 'strawd' manually to start the daemon."
50+
fi
4651

4752
echo ""
4853
echo "---------------------------------------------------"

scripts/install_service.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ fi
1515

1616
echo "Found strawd at: $BIN_PATH"
1717

18+
# Check if systemctl is available
19+
if ! command -v systemctl >/dev/null 2>&1; then
20+
echo "Warning: 'systemctl' not found. Skipping automatic service installation."
21+
echo "You can still run 'strawd' manually to start the daemon."
22+
exit 0
23+
fi
24+
1825
# Create systemd user directory if it doesn't exist
1926
mkdir -p "$SYSTEMD_DIR"
2027

@@ -24,7 +31,7 @@ echo "Generating $SERVICE_FILE..."
2431
cat > "$SERVICE_FILE" <<EOF
2532
[Unit]
2633
Description=Straw File Automation Daemon
27-
Documentation=https://github.com/youruser/straw
34+
Documentation=https://github.com/raythurman2386/straw
2835
After=network.target
2936
3037
[Service]

0 commit comments

Comments
 (0)