Skip to content

Commit c4c795a

Browse files
committed
install script added
1 parent 3cca3bd commit c4c795a

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ jobs:
4141
run: |
4242
mkdir cyrus
4343
cp ./target/release/cyrus ./cyrus
44+
cp ./scripts/install.sh ./cyrus
4445
cp -r ./stdlib ./cyrus
4546
4647
- name: Upload as artifact
4748
uses: actions/upload-artifact@v4
4849
with:
4950
name: cyrus
5051
path: ./cyrus
51-
compression-level: 0

scripts/install.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Define installation path
4+
INSTALL_DIR="/usr/bin"
5+
EXECUTABLE_NAME="cyrus"
6+
SOURCE_PATH="./cyrus"
7+
8+
# Check if running as root
9+
if [[ $EUID -ne 0 ]]; then
10+
echo "Please run this script as root or use sudo."
11+
exit 1
12+
fi
13+
14+
if [[ ! -f "$SOURCE_PATH" ]]; then
15+
echo "Error: '$SOURCE_PATH' not found. Make sure the Cyrus binary is exists in this directory."
16+
exit 1
17+
fi
18+
19+
cp "$SOURCE_PATH" "$INSTALL_DIR/$EXECUTABLE_NAME"
20+
21+
chmod +x "$INSTALL_DIR/$EXECUTABLE_NAME"
22+
23+
if command -v "$EXECUTABLE_NAME" &>/dev/null; then
24+
echo "Cyrus has been installed successfully!"
25+
echo ""
26+
echo "You can now run 'cyrus' from anywhere."
27+
echo ""
28+
echo " Quick Usage:"
29+
echo " - Check version: cyrus version"
30+
echo " - Show help: cyrus help"
31+
echo ""
32+
echo "Happy coding with Cyrus Lang! 👾"
33+
else
34+
echo "Installation failed."
35+
exit 1
36+
fi

0 commit comments

Comments
 (0)