File tree Expand file tree Collapse file tree 5 files changed +32
-7
lines changed
Expand file tree Collapse file tree 5 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,15 @@ sk-github(){
428428 _sk-github_curl https://api.github.com
429429}
430430
431+ sk-github-release-list-latest (){
432+ local owner_repo=" ${1:- sigoden/ upt} "
433+ local output=' '
434+ sk-git-creds
435+ echo " https://api.github.com/repos/$owner_repo /releases/latest"
436+ output=` _sk-github_curl https://api.github.com/repos/$owner_repo /releases/latest`
437+ echo $output | jq -r ' .'
438+ }
439+
431440sk-github-org-list-watchers (){
432441 local reponame=$1
433442 local output=' '
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ _sk_logger_common(){
88 log_name=" ${LOG_NAME:- " ${NAME} .log" } "
99
1010 if [[ $EUID -ne 0 ]]; then
11- log_dir_default=~ /log
11+ log_dir_default=" ${HOME} /log"
1212 else
1313 log_dir_default=/var/log/shellkit
1414 fi
@@ -18,7 +18,10 @@ _sk_logger_common(){
1818 export LOG_DIR=$log_dir
1919
2020 if [[ ! -d " $log_dir " ]]; then
21- sk-dir-make $log_dir
21+ if ! sk-dir-make $log_dir ; then
22+ log_dir=/tmp
23+ export LOG_DIR=$log_dir
24+ fi
2225 # dont use logrotate if we have a date based log_dir
2326 year=$( date +" %Y" )
2427 if ! grep -q $year <<< $( echo $log_dir ); then
Original file line number Diff line number Diff line change @@ -26,10 +26,18 @@ sk-logrotate(){
2626
2727 sk-pack-install -b logrotate --post_install ' brew services start logrotate'
2828
29- if [[ -d /usr/local/etc/logrotate.d ]]; then
30- logrotate_config_file=/usr/local/etc/logrotate.d/${config_name}
31- export LOGROTATE_CONFIG_FILE=$logrotate_config_file
32- logrotate_sudo=0
29+ if [[ " $PLATFORM " = ' Darwin' ]]; then
30+
31+ if [[ -d /opt/homebrew/etc/logrotate.d ]]; then
32+ logrotate_config_file=/opt/homebrew/etc/logrotate.d/${config_name}
33+ export LOGROTATE_CONFIG_FILE=$logrotate_config_file
34+ logrotate_sudo=0
35+ elif [[ -d /usr/local/etc/logrotate.d ]]; then
36+ logrotate_config_file=/usr/local/etc/logrotate.d/${config_name}
37+ export LOGROTATE_CONFIG_FILE=$logrotate_config_file
38+ logrotate_sudo=0
39+ fi
40+
3341 else
3442 logrotate_config_file=/etc/logrotate.d/${config_name}
3543 export LOGROTATE_CONFIG_FILE=$logrotate_config_file
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ alias pc="pre-commit"
77alias pci=" pre-commit install"
88alias pca=" sk-pre-commit-all"
99
10+ sk-host-to-fqdn (){
11+ local host=" ${1:- localhost} "
12+ host " $host " | awk ' /has address/ {print $1}'
13+ }
14+
1015sk-group-user-uid-highest (){
1116 group_name=" ${1:- wibble} "
1217
Original file line number Diff line number Diff line change 3232}
3333
3434sk-xml-pretty (){
35- sk-pack-install -b xmllint -p libxml2-utils
35+ sk-pack-install -b xmllint --keg_force - p libxml2-utils --mac_package libxml2
3636 xmllint --format " $@ "
3737}
3838
You can’t perform that action at this time.
0 commit comments