Skip to content

Commit d2214ba

Browse files
committed
Make script path auto-detected and update installation docs
1 parent 2a3a3d7 commit d2214ba

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
## Installation
2626

2727
```bash
28-
# Clone the repository
28+
# Clone the repository (anywhere you want)
2929
git clone https://github.com/Dxsk/kvm-cli-scripts.git
30-
cp -r kvm-cli-scripts ~/Documents/scripts/kvm/
30+
cd kvm-cli-scripts
3131

3232
# Source in current shell
33-
source ~/Documents/scripts/kvm/source.me
33+
source source.me
3434

3535
# For permanent setup, add to ~/.bashrc or ~/.zshrc
36-
echo 'source ~/Documents/scripts/kvm/source.me' >> ~/.bashrc
36+
echo 'source /path/to/kvm-cli-scripts/source.me' >> ~/.bashrc
3737
```
3838

3939
## Usage

source.me

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# KVM Scripts - Shell Functions
33
# Source this file in your .bashrc or .zshrc to enable kvm.* commands
44

5-
KVM_SCRIPTS_PATH="/home/$USER/Documents/scripts/kvm/"
5+
# Auto-detect script directory (works wherever you install it)
6+
# To set manually, comment the line below and uncomment the next one:
7+
# KVM_SCRIPTS_PATH="/your/custom/path/to/kvm-cli-scripts"
8+
KVM_SCRIPTS_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
69

710
kvm.clone () { sudo bash "$KVM_SCRIPTS_PATH/clone.bash"; }
811
kvm.snapshot () { sudo bash "$KVM_SCRIPTS_PATH/snapshot.bash"; }

0 commit comments

Comments
 (0)