From b04ea7d3d725365444893b3e179f2dd9edf77092 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 20 Feb 2023 20:02:56 +0100 Subject: added: (stowcmds) laptop stowcmds and error handling --- stowcmds.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'stowcmds.sh') diff --git a/stowcmds.sh b/stowcmds.sh index f7b3345..4874d48 100644 --- a/stowcmds.sh +++ b/stowcmds.sh @@ -1,7 +1,20 @@ -#!/usr/bin/env bash +#!/bin/sh -case "${MACH:=desktop}" in - 'desktop') +if ! stow --version > /dev/null 2>&1 +then + echo "E: stow not installed or not found" 1>&2 + exit 1 +fi +if [ -n "$MACH" ] +then + echo "I: stowing for $MACH" +else + echo "E: MACH not set" + exit 1 +fi + +case "$MACH" in + "desktop") mkdir -p "$HOME/bin" stow -d bin/ -t "$HOME/bin" -R common dmscripts extra mkdir -p "$HOME/.config" @@ -15,6 +28,13 @@ case "${MACH:=desktop}" in stow -d config/ -t "$HOME/.config" -R essentials common stow -d config/ -t "$HOME/" -R zshrc ;; + "laptop") + mkdir -p "$HOME/bin" + stow -d bin/ -t "$HOME/bin" -R common dmscripts extra + mkdir -p "$HOME/.config" + stow -d config/ -t "$HOME/.config" -R essentials common extra theme hyprland X + stow -d config/ -t "$HOME/" -R zshrc + ;; *) break esac -- cgit v1.2.3