Skip to content

Commit

Permalink
🚸 correct flow to thing sync on fresh or alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhomer committed Nov 19, 2023
1 parent 06ba9c1 commit dcd6ee6
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 105 deletions.
1 change: 1 addition & 0 deletions bin/dotme-apk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ log:: "updating apk"
apk add bash
apk add curl
apk add git
apk add python3
apk add stow

should-run -fu dotme-apk
Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-doctor
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ fi
#
ipv6LocalHostRoute=$(grep localhost /etc/hosts | grep "::1" | grep -v "^#" | wc -l)
if [ ${ipv6LocalHostRoute} -eq 1 ] ; then
log::error "/etc/hosts has ipv6 localhost enabled which is not reliable, please comment out"
log::warn "/etc/hosts has ipv6 localhost enabled which is not reliable, please comment out"
fi
2 changes: 1 addition & 1 deletion bin/dotme-gem
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ should-run $0 || exit 0

$(shim) && cd ${ME} && . bin/i.sh
if ! command -v rbenv ; then
log::info "rbenv not installed"
log::warn "rbenv not installed"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-gitme
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ should-run -m 7 $@ $0 || exit 0

$(shim) && cd ${ME} && . bin/i.sh
if ! command -v fasd ; then
log::info "fasd not installed"
log::warn "fasd not installed"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-node
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $(shim) && cd ${ME} && . bin/i.sh
[ ! -d ~/.nvm ] && mkdir ~/.nvm

if ! command -v node ; then
log::info "node not installed"
log::warn "node not installed"
exit
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-pip
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ should-run -m 30 $0 $REQUIREMENTS || exit 0
$(shim) && cd ${ME} && . bin/i.sh

if ! command -v pip3 ; then
log::info "pip3 not installed"
log::warn "pip3 not installed"
exit
fi

Expand Down
4 changes: 4 additions & 0 deletions bin/dotme-pull
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ set -e
should-run -m 1h $0 || exit 0

$(shim) && cd ${ME} && . bin/i.sh
if ! command -v rbenv ; then
log::warn "git not installed"
exit
fi

if git config pull.rebase > /dev/null ; then
cd ${DOTFILES_DIR}
Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-rust
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(shim) && cd ${ME} && . bin/i.sh
log:: "configuring rust"

if ! command -v rustup-init ; then
log::info "rustup-init not installed"
log::warn "rustup-init not installed"
exit
fi

Expand Down
4 changes: 4 additions & 0 deletions bin/dotme-start
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ touch $HOME/.config/dotme/.light
if [[ ! -d ~/projects ]] ; then
echo "Creating ~/projects directory"
mkdir ~/projects/
if [[ ! -d ~/projects/things ]] ; then
echo "Creating ~/projects/things directory"
mkdir ~/projects/things
fi
fi

if ! command -v bash > /dev/null 2>&1; then
Expand Down
2 changes: 1 addition & 1 deletion bin/dotme-test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ should-run -m 7 $@ $0 || exit 0
$(shim) && cd ${ME} && . bin/i.sh

if ! command -v node ; then
log::info "pnpm not installed"
log::warn "pnpm not installed"
exit
fi

Expand Down
12 changes: 8 additions & 4 deletions bin/functions/log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,21 @@ function log::status() {
"$status" "$message"
}

function log::trace() {
[[ "$TRACEME" == "y" ]] && printf "\e[38;5;238m$*\e[0m\n"
return 0
}

function log::info() {
printf "\e[36m$*\e[0m\n"
}

function log::trace() {
[[ "$TRACEME" == "y" ]] && printf "\e[38;5;238m$*\e[0m\n"
return 0
function log::warn() {
printf "\e[33m$*\e[0m\n"
}

function log::error() {
printf "\e[33m$*\e[0m\n"
printf "\e[31m$*\e[0m\n"
}

# Error and exit
Expand Down
7 changes: 4 additions & 3 deletions bin/test-log
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ log:: "a log message"
log:: another log message
log:: "info with multiple words"
log:: OK status
log:: error with $(log::bold message)
log:: skip this that
log:: box this that
log:: box "a long message, a long message, a long message" that
log::warn warn with $(log::bold message)
log::error error with $(log::bold message)
log::box this that
log::box "a long message, a long message, a long message" that
log::box this "a long message, a long message, a long message"
log::trim 15 "a long message, a long message"
log::trim 15 "short"
Expand Down
12 changes: 8 additions & 4 deletions bin/things-sync
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ esac done
cd $THINGS_DIR
git synk -w $FETCH_WINDOW $EXTRA_ARGS

# Fix modified time for things
for child in */ ; do
(cd $child ; git fix-mtime)
done
if [[ -z "*/" ]] ; then
# Fix modified time for things
for child in */ ; do
(cd $child ; git fix-mtime)
done
else
echo "No thing directories to fix mtime"
fi
4 changes: 2 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"author": "anon",
"description": "dotme test",
"devDependencies": {
"@types/node": "20.9.0",
"@types/node": "20.9.2",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"bats": "1.10.0",
"bats-assert": "2.0.0",
"bats-support": "0.3.0",
"eslint": "8.53.0",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-sonarjs": "0.23.0",
Expand Down
Loading

0 comments on commit dcd6ee6

Please sign in to comment.