better error handling (again)
This commit is contained in:
parent
6409d6d146
commit
abb286ba2a
2 changed files with 11 additions and 1 deletions
|
@ -11,7 +11,12 @@ i have an unhealthy relationship with overlayfs. i also like to easily change my
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
configctl [OPTIONS] <changeset> [unmount]
|
configctl [OPTIONS] <changeset_name> [unmount]
|
||||||
|
|
||||||
|
options
|
||||||
|
-a, --automount automatically enable the changeset service file
|
||||||
|
-f, --force ovewrite existing service file
|
||||||
|
-s, --service-path the path to write the service file
|
||||||
```
|
```
|
||||||
|
|
||||||
by default, the configctl expects the base configuration set to exist in `$XDG_DATA_HOME/config/base` (usually `~/.local/share/config/base`) and the changesets to exist in `$XDG_DATA_HOME/config/changeset`. changes while the configuration is mounted will be written to `$XDG_STATE_HOME/config/{<changeset>,.work_<changeset>}`
|
by default, the configctl expects the base configuration set to exist in `$XDG_DATA_HOME/config/base` (usually `~/.local/share/config/base`) and the changesets to exist in `$XDG_DATA_HOME/config/changeset`. changes while the configuration is mounted will be written to `$XDG_STATE_HOME/config/{<changeset>,.work_<changeset>}`
|
||||||
|
|
|
@ -60,6 +60,11 @@ CHANGESET="$CHANGESET_DIR/$SELECTED"
|
||||||
UPPER_DIR="$XDG_STATE_HOME/config/$SELECTED"
|
UPPER_DIR="$XDG_STATE_HOME/config/$SELECTED"
|
||||||
WORKDIR="$XDG_STATE_HOME/config/.work_$SELECTED"
|
WORKDIR="$XDG_STATE_HOME/config/.work_$SELECTED"
|
||||||
|
|
||||||
|
if [ -z "$SELECTED" ]; then
|
||||||
|
usage
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d "$CHANGESET" ]; then
|
if [ ! -d "$CHANGESET" ]; then
|
||||||
echo "'$CHANGESET' not found."
|
echo "'$CHANGESET' not found."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue