bugfix: fix extras plugin. Install asdf automatically. move default source script into template
parent
dbe2989272
commit
b1860879dc
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/env bash
|
||||
|
||||
# where the .files repo lives. By default it's assumed to be in ${HOME}/.files
|
||||
export FILES_ROOT="${HOME}/.files";
|
||||
|
||||
# Set plugins to load here. Run files_plugins_list to see available plugins.
|
||||
export FILES_PLUGINS=("brew" "ssh" "vim" "git-extras" "asdf" "helm" "starship" "extras");
|
||||
|
||||
[[ -s "${HOME}/.files/sourceme.sh" ]] && source ${HOME}/.files/sourceme.sh;
|
||||
|
|
@ -4,6 +4,11 @@
|
|||
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
|
||||
ASDF_COMPLETIONS="$ASDF_DIR/completions"
|
||||
|
||||
if [[ ! -f "${ASDF_DIR}/asdf.sh" ]] || [[ -f $(which brew) ]]; then
|
||||
echo "[asdf] Installing asdf via brew";
|
||||
brew install asdf;
|
||||
fi
|
||||
|
||||
# If not found, check for Homebrew package
|
||||
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && [[ -f $(which brew 2&>1) ]]; then
|
||||
ASDF_DIR="$(brew --prefix asdf)"
|
||||
|
|
|
|||
|
|
@ -39,9 +39,8 @@ export GIT_EDITOR=vim;
|
|||
export EDITOR=$GIT_EDITOR;
|
||||
export VISUAL=$EDITOR;
|
||||
|
||||
export DEFAULT_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;
|
||||
|
||||
export PATH=${DEFAULT_PATH}:${HOME}/.bin;
|
||||
# export DEFAULT_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;
|
||||
# export PATH=${DEFAULT_PATH}:${HOME}/.bin;
|
||||
|
||||
if [[ -d "${HOME}/.dotnet" ]]; then
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1;
|
||||
|
|
@ -53,6 +52,11 @@ if [[ -d "${HOME}/.bin" ]]; then
|
|||
PATH=${HOME}/.bin:${PATH};
|
||||
fi
|
||||
|
||||
if [[ -n "$DESKTOP_SESSION" ]];then
|
||||
eval $(gnome-keyring-daemon --start);
|
||||
export SSH_AUTH_SOCK;
|
||||
fi
|
||||
|
||||
# http://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux
|
||||
# run these to increase concurrent connections in linux
|
||||
# sudo sysctl net.ipv4.ip_local_port_range="18000 61000"
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ fi
|
|||
|
||||
|
||||
if ! [[ -d "${FILES_EXTRAS_DIR}" ]]; then
|
||||
mkdir -p "${FILES_EXTRAS_DIR}";
|
||||
files_linkdir "${FILES_PLUGIN_ROOT}/default.d/" "${FILES_EXTRAS_DIR}/";
|
||||
files_debug_log "[extras] installing default files"
|
||||
files_linkdir "${FILES_PLUGIN_ROOT}/defaults.d/" "${FILES_EXTRAS_DIR}/";
|
||||
fi
|
||||
|
||||
for file in "${FILES_EXTRAS_DIR}"/*; do
|
||||
|
|
|
|||
14
sourceme.sh
14
sourceme.sh
|
|
@ -25,9 +25,17 @@ files_linkdir() {
|
|||
#ls -lA "${SOURCE}" | grep "^-" | awk '{print $9}' | xargs -I {} ln -vfs "${SOURCE}/{}" "${DEST}/{}"
|
||||
}
|
||||
|
||||
files_plugins_list() {
|
||||
for plugin in ${FILES_PLUGINS[@]}; do
|
||||
export FILES_PLUGIN_ROOT="${FILES_ROOT}/plugins/${plugin}";
|
||||
echo "\"${plugin}\" @ ${FILES_PLUGIN_ROOT}";
|
||||
unset FILES_PLUGIN_ROOT;
|
||||
done
|
||||
}
|
||||
|
||||
files_install() {
|
||||
local target=${1};
|
||||
local FILES_SOURCEME="[[ -s \"\${HOME}/.files/sourceme.sh\" ]] && source \${HOME}/.files/sourceme.sh";
|
||||
local FILES_SOURCEME=$(cat ${FILES_ROOT}/install_script.sh);
|
||||
|
||||
if [[ -f "${target}" ]]; then
|
||||
if [[ -z "$(cat ${target} | grep 'sourceme.sh')" ]]; then
|
||||
|
|
@ -48,15 +56,13 @@ load_env() {
|
|||
fi
|
||||
|
||||
files_debug_log "[load_env] \$FILES_ROOT = ${FILES_ROOT}";
|
||||
|
||||
export FILES_USER_CONFIG="${HOME}/.config";
|
||||
|
||||
if [[ -z "${FILES_PLUGINS}" ]]; then
|
||||
export FILES_PLUGINS=("brew" "ssh" "vim" "extras" "git-extras" "asdf" "helm" "starship");
|
||||
export FILES_PLUGINS=("brew" "ssh" "vim" "git-extras" "asdf" "helm" "starship" "extras");
|
||||
fi
|
||||
files_debug_log "[load_env] using plugins FILES_PLUGINS=${FILES_PLUGINS}";
|
||||
|
||||
|
||||
files_debug_log "[load_env] \$HOME='$HOME'";
|
||||
# load plugns
|
||||
for plugin in ${FILES_PLUGINS[@]}; do
|
||||
|
|
|
|||
Loading…
Reference in New Issue