mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-19 04:54:45 +00:00
fix(shell): rework shell config for more stability
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
# Helper variables, override with ENVs like `VERBOSE=1 dfm help`
|
||||
: "${VERBOSE:=0}"
|
||||
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||
: "${SHARED_SCRIPT:=$DOTFILES/scripts/shared.sh}"
|
||||
: "${BREWFILE:=$DOTFILES/config/homebrew/Brewfile}"
|
||||
: "${HOSTFILES:=$DOTFILES/hosts}"
|
||||
|
||||
@@ -17,9 +16,9 @@ SCRIPT=$(basename "$0")
|
||||
|
||||
VERSION_NVM="v0.39.5"
|
||||
|
||||
export DOTFILES_SHARED_LOADED=""
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
# shellcheck source=./../../scripts/shared.sh
|
||||
source "$SHARED_SCRIPT"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
# Loads configs for better installation experience
|
||||
x-load-configs
|
||||
|
||||
16
local/bin/x-dc
Executable file
16
local/bin/x-dc
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Create directory if it doesn't exist already
|
||||
#
|
||||
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
||||
# Licensed under MIT License. http://www.opensource.org/licenses/mit-license.
|
||||
|
||||
dir="$1"
|
||||
|
||||
[ $# -eq 0 ] && {
|
||||
echo "Usage: $0 full/path/to/dir/to/create"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ ! -d "$dir" ]; then
|
||||
mkdir -p "$dir" && exit 0
|
||||
fi
|
||||
@@ -2,13 +2,13 @@
|
||||
# Load our configuration files
|
||||
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
|
||||
|
||||
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
DOTFILES="$HOME/.dotfiles"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
CONFIG_PATH="$DOTFILES/config"
|
||||
|
||||
# Load the shell dotfiles, and then some:
|
||||
function load()
|
||||
function x-load-config-fn()
|
||||
{
|
||||
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
|
||||
FILENAME="$FILE"
|
||||
@@ -28,4 +28,4 @@ function load()
|
||||
done
|
||||
}
|
||||
|
||||
load
|
||||
x-load-config-fn
|
||||
|
||||
Reference in New Issue
Block a user