Skip to content

Commit

Permalink
Updated script to make klipper directory optional if not in the klipp…
Browse files Browse the repository at this point in the history
…er directory
  • Loading branch information
dhoard committed May 7, 2024
1 parent 3778d21 commit 2b5bf95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ cd ~
git clone https://github.com/Klipper3d/klipper
cd klipper
make menuconfig
../klipper-builder/build-klipper.sh .
../klipper-builder/build-klipper.sh
```
9 changes: 7 additions & 2 deletions build-klipper.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/bin/bash

# Check if an argument is provided
if [ $# -ne 1 ]; then
if [ $# -gt 1 ]; then
echo "Usage: $0 <Klipper directory>"
exit 1
fi

if [ $# -eq 0 ]; then
KLIPPER_DIRECTORY=.
else
KLIPPER_DIRECTORY=$1
fi

# Check if the directory exists
KLIPPER_DIRECTORY=$1
if [ ! -d "${KLIPPER_DIRECTORY}" ]; then
echo "Error: Directory '${KLIPPER_DIRECTORY}' does not exist."
exit 1
Expand Down

0 comments on commit 2b5bf95

Please sign in to comment.