-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuild.sh
More file actions
executable file
Β·57 lines (45 loc) Β· 1.35 KB
/
rebuild.sh
File metadata and controls
executable file
Β·57 lines (45 loc) Β· 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Rebuild script for howmany - rebuilds cargo and reestablishes symlink
set -e # Exit on any error
echo "π¨ Rebuilding howmany..."
echo "========================"
# Clean previous build
echo "π§Ή Cleaning previous build..."
cargo clean
# Build the project
echo "ποΈ Building project..."
cargo build --release
# Check if build was successful
if [ $? -eq 0 ]; then
echo "β
Build successful!"
else
echo "β Build failed!"
exit 1
fi
# Create symlink (remove existing one first if it exists)
SYMLINK_PATH="/usr/local/bin/howmany"
BINARY_PATH="$(pwd)/target/release/howmany"
echo "π Setting up symlink..."
# Remove existing symlink if it exists
if [ -L "$SYMLINK_PATH" ]; then
echo " Removing existing symlink..."
sudo rm "$SYMLINK_PATH"
fi
# Create new symlink
echo " Creating symlink: $SYMLINK_PATH -> $BINARY_PATH"
sudo ln -s "$BINARY_PATH" "$SYMLINK_PATH"
# Verify the symlink works
if [ -L "$SYMLINK_PATH" ] && [ -e "$SYMLINK_PATH" ]; then
echo "β
Symlink created successfully!"
echo "π You can now use 'howmany' from anywhere!"
echo ""
echo "Testing the installation:"
howmany --version
else
echo "β Failed to create symlink!"
exit 1
fi
echo ""
echo "π Rebuild complete! The enhanced howmany is ready to use."
echo " Try: howmany interactive"
echo " Or: howmany count --verbose"