Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [Feature]: Export/Import packages for multiple machines #114

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
13628d1
Paths are now loaded before everything
gtrabanco Feb 13, 2021
651c564
Now you can dump packages by hostname or whatever name you want to gi…
gtrabanco Mar 13, 2021
0930acb
Added preview option
gtrabanco Mar 14, 2021
03b2a2c
Fixed that volta and npm were importing like no multiple machines wer…
gtrabanco Mar 14, 2021
b353d83
Some mess fixed that would not affect the script or performance
gtrabanco Mar 21, 2021
2ab33fb
Core update, adding some functions that will be used with other featu…
gtrabanco Mar 28, 2021
dbc9316
Improved output::join with a stackoverflow function in: https://stack…
gtrabanco Mar 28, 2021
addcdbb
Deleted duplicate functions that were in str.sh and output. Added arr…
gtrabanco Mar 28, 2021
c9a9033
Merged with branch feature/core
gtrabanco Mar 28, 2021
db3a6b9
Added closed and unapproved PR #61 because it is needed when I use be…
gtrabanco Mar 28, 2021
4e744a7
Fixed error that all the the time say that script_name where not dis/…
gtrabanco Mar 28, 2021
6fd9349
Fixed the use of refactored function changed to str.sh. Changed outpu…
gtrabanco Mar 28, 2021
7107be1
Added missing autoupdate command for docpars
gtrabanco Mar 28, 2021
145a56c
Fixed all the mess with loader and vars
gtrabanco Mar 28, 2021
5802b61
Added a way to modify DOTFILES_PATH structure when add a feature to d…
gtrabanco Mar 29, 2021
747042a
Fixed error when no subcommand were passed
gtrabanco Mar 29, 2021
639d244
Fixed for non alphanumeric files
gtrabanco Mar 29, 2021
7ebb649
Fixed for non alphanumeric files. No include . and .. directories.
gtrabanco Mar 29, 2021
f85b4bf
Now you can apply directly a symlink docbot file if you know the name…
gtrabanco Mar 29, 2021
19204d1
Merged feature/core
gtrabanco Mar 29, 2021
5f8e96f
Fixed output::question in macOS now does not print a newline like in …
gtrabanco Mar 31, 2021
659326f
Added new functions to get the current script_name or script_path whe…
gtrabanco Mar 31, 2021
1a6bdb8
Added function to conver mayus to lower
gtrabanco Mar 31, 2021
1975a28
Fixed quotation
gtrabanco Mar 31, 2021
09bddff
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Mar 31, 2021
0279d4a
Added ZDOTDIR
gtrabanco Mar 31, 2021
02a7547
Fixed error in path to load zsh loader for DOTLY
gtrabanco Mar 31, 2021
1fbdc5d
Fixed quotation that made loop array not working
gtrabanco Mar 31, 2021
d9e058d
Fix error
gtrabanco Mar 31, 2021
b4f2dec
Reverting changes
gtrabanco Apr 1, 2021
5902a6f
Fixed error with array. Modified templating so now replace directly i…
gtrabanco Apr 1, 2021
c7f92ca
Merge branch 'master' into feature/core
gtrabanco Apr 1, 2021
b5342cf
Added async library
gtrabanco Apr 1, 2021
73bf295
Merged feature/core
gtrabanco Apr 1, 2021
e2770cc
Splitted symlinks feature that was added in another different script
gtrabanco Apr 1, 2021
e5eba99
Load async functions with the all core functionality
gtrabanco Apr 1, 2021
f168d56
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 1, 2021
a4c48cf
Fixed auto init scripts loader
gtrabanco Apr 2, 2021
623262a
Fixed autoload init scripts with bash
gtrabanco Apr 2, 2021
ec37721
Fixed error #93 with bash autocompletions
gtrabanco Apr 2, 2021
ab04c2a
First autouptate version. Help Needed.
gtrabanco Apr 2, 2021
b055d27
Merged feature/async_autoupdate
gtrabanco Apr 2, 2021
708d03e
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 2, 2021
e5f7db3
Deleted some debug information
gtrabanco Apr 2, 2021
0f003a8
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 2, 2021
d97fdd5
Making more clear the messages when dumping
gtrabanco Apr 2, 2021
49d206c
Fixed message formating and some '! -z' in ifs instead of '-n'
gtrabanco Apr 2, 2021
2984b4d
Some minor quoations
gtrabanco Apr 2, 2021
a777f45
Deleted some debug information
gtrabanco Apr 2, 2021
dd07b37
Deleted some debug information again due the git reset --hard I have …
gtrabanco Apr 2, 2021
effbfe8
Fixed error with output::yesno which made this function to always ret…
gtrabanco Apr 2, 2021
4d8d2e2
Fix error when try to execute a broken link to init script
gtrabanco Apr 4, 2021
ae4a4df
Fixed the use of files::check_if_path_is_older, refactored files::che…
gtrabanco Apr 4, 2021
b053231
Fixed the use of shift when not necessary
gtrabanco Apr 4, 2021
13b6516
Fixed the usage of variable name path inside 'files::check_if_path_is…
gtrabanco Apr 4, 2021
5d0afda
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 4, 2021
538f7d3
Replaced 'source' for '.' as posix standard... Delete some debug comm…
gtrabanco Apr 5, 2021
da98c09
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 5, 2021
8be2559
Trying to fix error that produce not to enable/disable multiple scrip…
gtrabanco Apr 5, 2021
342b3b2
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 5, 2021
a9feb37
Fixed that scripts ended in DOTLY_PATH instead of current dir due to …
gtrabanco Apr 7, 2021
3b6d67e
Merge branch 'feature/core' into feature/multiple_machines
gtrabanco Apr 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 6 additions & 39 deletions dotfiles_template/shell/bash/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,9 @@ export DOTFILES_PATH="XXX_DOTFILES_PATH_XXX"
export DOTLY_PATH="$DOTFILES_PATH/modules/dotly"
export DOTLY_THEME="codely"

if [[ "$(ps -p $$ -ocomm=)" =~ (bash$) ]]; then
__right_prompt() {
RIGHT_PROMPT=""
[[ -n $RPS1 ]] && RIGHT_PROMPT=$RPS1 || RIGHT_PROMPT=$RPROMPT
if [[ -n $RIGHT_PROMPT ]]; then
n=$(($COLUMNS - ${#RIGHT_PROMPT}))
printf "%${n}s$RIGHT_PROMPT\\r"
fi
}
export PROMPT_COMMAND="__right_prompt"
fi

source "$DOTFILES_PATH/shell/init.sh"

PATH=$(
IFS=":"
echo "${path[*]}"
)
export PATH

themes_paths=(
"$DOTFILES_PATH/shell/bash/themes"
"$DOTLY_PATH/shell/bash/themes"
)

for THEME_PATH in ${themes_paths[@]}; do
THEME_PATH="${THEME_PATH}/$DOTLY_THEME.sh"
[ -f "$THEME_PATH" ] && source "$THEME_PATH" && break
done

for bash_file in "$DOTLY_PATH"/shell/bash/completions/*; do
source "$bash_file"
done

if [ -n "$(ls -A "$DOTFILES_PATH/shell/bash/completions/")" ]; then
for bash_file in "$DOTFILES_PATH"/shell/bash/completions/*; do
source "$bash_file"
done
fi
if [[ -f "$DOTLY_PATH/shell/bash/init-dotly.sh" ]]
then
. "$DOTLY_PATH/shell/bash/init-dotly.sh"
else
echo "\033[0;31m\033[1mDOTLY Could not be loaded\033[0m"
fi
22 changes: 3 additions & 19 deletions dotfiles_template/shell/exports.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export DOTLY_AUTO_UPDATE_DAYS=7
export DOTLY_AUTO_UPDATE_MODE="reminder" # reminder*, auto, prompt

export JAVA_HOME='/Library/Java/JavaVirtualMachines/amazon-corretto-15.jdk/Contents/Home'
export GEM_HOME="$HOME/.gem"
export GOPATH="$HOME/.go"
Expand All @@ -6,22 +9,3 @@ export FZF_DEFAULT_OPTS='
--color=pointer:#ebdbb2,bg+:#3c3836,fg:#ebdbb2,fg+:#fbf1c7,hl:#8ec07c,info:#928374,header:#fb4934
--reverse
'

export path=(
"$HOME/bin"
"$DOTLY_PATH/bin"
"$DOTFILES_PATH/bin"
"$JAVA_HOME/bin"
"$GEM_HOME/bin"
"$GOPATH/bin"
"$HOME/.cargo/bin"
"/usr/local/opt/ruby/bin"
"/usr/local/opt/python/libexec/bin"
"/opt/homebrew/bin"
"/usr/local/bin"
"/usr/local/sbin"
"/bin"
"/usr/bin"
"/usr/sbin"
"/sbin"
)
18 changes: 18 additions & 0 deletions dotfiles_template/shell/paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export path=(
"$HOME/bin"
"$DOTLY_PATH/bin"
"$DOTFILES_PATH/bin"
"$JAVA_HOME/bin"
"$GEM_HOME/bin"
"$GOPATH/bin"
"$HOME/.cargo/bin"
"/usr/local/opt/ruby/bin"
"/usr/local/opt/python/libexec/bin"
"/opt/homebrew/bin"
"/usr/local/bin"
"/usr/local/sbin"
"/bin"
"/usr/bin"
"/usr/sbin"
"/sbin"
)
29 changes: 6 additions & 23 deletions dotfiles_template/shell/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
# Uncomment for debuf with `zprof`
# zmodload zsh/zprof

# ZSH Ops
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FCNTL_LOCK
setopt +o nomatch
# setopt autopushd

# Start zim
source "$ZIM_HOME/init.zsh"

# Async mode for autocompletion
ZSH_AUTOSUGGEST_USE_ASYNC=true
ZSH_HIGHLIGHT_MAXLENGTH=300

source "$DOTFILES_PATH/shell/init.sh"

fpath=("$DOTFILES_PATH/shell/zsh/themes" "$DOTFILES_PATH/shell/zsh/autocompletions" "$DOTLY_PATH/shell/zsh/themes" "$DOTLY_PATH/shell/zsh/completions" $fpath)

autoload -Uz promptinit && promptinit
prompt ${DOTLY_THEME:-codely}

source "$DOTLY_PATH/shell/zsh/bindings/dot.zsh"
source "$DOTLY_PATH/shell/zsh/bindings/reverse_search.zsh"
source "$DOTFILES_PATH/shell/zsh/key-bindings.zsh"
if [[ -f "$DOTLY_PATH/shell/zsh/init-dotly.sh" ]]
then
. "$DOTLY_PATH/shell/zsh/init-dotly.sh"
else
echo "\033[0;31m\033[1mDOTLY Could not be loaded\033[0m"
fi
5 changes: 5 additions & 0 deletions dotfiles_template/symlinks/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
create: true
force: true

- create:
- $DOTLY_PATH/shell/init-scripts
- $DOTFILES_PATH/shell/init-scripts
- $DOTFILES_PATH/shell/init-scripts.enabled

- link:
~/.bash_profile: shell/bash/.bash_profile
~/.bashrc: shell/bash/.bashrc
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/_main.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

if ! ${DOT_MAIN_SOURCED:-false}; then
for file in $DOTLY_PATH/scripts/core/{args,collections,documentation,dot,git,log,platform,output,str}.sh; do
for file in $DOTLY_PATH/scripts/core/{args,array,async,collections,documentation,dot,files,git,log,platform,output,str}.sh; do
source "$file";
done;
unset file;
Expand Down
6 changes: 6 additions & 0 deletions scripts/core/array.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Usage: array::* "${arr1[@]}" "${arr2[@]}"
array::union() { echo "${@}" | tr ' ' '\n' | sort | uniq; }
array::disjunction() { echo "${@}" | tr ' ' '\n' | sort | uniq -u; }
array::difference() { echo "${@}" | tr ' ' '\n' | sort | uniq -d; }
Loading