Skip to content
Snippets Groups Projects
Commit 309779a2 authored by Keegan Mullaney's avatar Keegan Mullaney
Browse files

sublime config and shell string matching

simplify subl config and improve shell string searches with grep
parent bfea397e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,7 +14,7 @@
 
[ -z "$QC_CONFIG" ] && QC_CONFIG="$HOME/.qc"
[ -z "$QC_BACKUP" ] && QC_BACKUP="$QC_CONFIG/backup"
[ -z "$QC_SYNCED" ] && read -rep "Directory to store/sync your config: " -i "$HOME/" QC_SYNCED
[ -z "$QC_SYNCED" ] && read -rep "Directory to store/sync Sublime Text config: " -i "$HOME/" QC_SYNCED
 
# system and program config files
CONF1="$HOME/.bashrc"
Loading
Loading
@@ -26,7 +26,7 @@ CONF6="$HOME/.gitignore_global"
 
# config files copied from repositories
REPO1="/usr/share/autojump/autojump.sh" #autojump.bash in CentOS
REPO3="$QC_CONFIG/sublime/sublconfig/Preferences.sublime-settings"
REPO3="$QC_CONFIG/sublime/subl.conf"
REPO4="$QC_CONFIG/mutt/colors/mutt-colors-solarized-dark-16.muttrc"
REPO5="$QC_CONFIG/vim/vim.conf"
REPO6="$QC_CONFIG/git/gitignore_global"
Loading
Loading
@@ -80,8 +80,8 @@ qc_set_subl_config() {
 
repo_dir=$(lkm_trim_shortest_right_pattern "$REPO3" "/")
 
# make sure parent directory exists for symlink
mkdir -p "${user_dir%/*}"
# make sure directory exists for symlink
mkdir -p "$user_dir"
 
# check User directory exists in QC_SYNCED/sublime/User/, else move from $HOME/.config/sublime/User/
[ -d "$QC_SYNCED/sublime/User" ] || { mkdir -p "$QC_SYNCED/sublime/User" ; mv "$user_dir" "$QC_SYNCED/sublime/User" ; }
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ qc_gem_check() {
for pkg in "${gem_check_list[@]}"
do
if ~/.rbenv/shims/gem list ^"$pkg"$ -i >/dev/null 2>&1; then
pkg_version=$(~/.rbenv/shims/gem list ^"$pkg"$ | grep "${pkg}" | cut -d " " -f 2 | cut -d "(" -f 2 | cut -d ")" -f 1)
pkg_version=$(~/.rbenv/shims/gem list ^"$pkg"$ | grep "${pkg}" | cut -d' ' -f2 | cut -d'(' -f2 | cut -d')' -f1)
lkm_print_pkg_info "$pkg" "$pkg_version"
else
echo -e " ${YELLOW_BLACK} * $pkg [not installed] ${NONE_WHITE}"
Loading
Loading
@@ -124,7 +124,7 @@ qc_install_ruby() {
# export MAKE=make
 
# install the latest stable ruby version
ruby_global_v=$(~/.rbenv/bin/rbenv install --list | tr -d ' ' | grep "^2.*\.[0-9]$" | tail -1)
ruby_global_v=$(~/.rbenv/bin/rbenv install --list | tr -d ' ' | grep "^[[:digit:]].[[:digit:]].[[:digit:]]$" | tail -1)
[ $? -eq 0 ] && ~/.rbenv/bin/rbenv install "$ruby_global_v"
 
# set global ruby version
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@
 
# -------------------------- SETUP PARAMETERS
 
[ -z "$NODE_LTS_V" ] && NODE_LTS_V=v6.11.0
[ -z "$NODE_LTS_V" ] && NODE_LTS_V=6
[ -z "$NVM_V" ] && NVM_V=0.33.2
 
# -------------------------- MISSING PROGRAM CHECKS
Loading
Loading
@@ -43,13 +43,12 @@ qc_nvm() {
lkm_has nvm || lkm_error "nvm install failed"
 
# get latest version
# not working with nvm command inside script
# node_v=$(nvm ls-remote | grep "v${NODE_LTS_V}.*\.*" | tr -d ' ' | cut -d'(' -f1 | tail -1)
node_v=$(nvm ls-remote | grep "v${NODE_LTS_V}.*\.*" | tr -d ' ' | cut -d'(' -f1 | tail -1)
 
# install nodejs
nvm install "$NODE_LTS_V"
nvm install "$node_v"
 
if [ $? -eq 0 ]; then
if [[ $? -eq 0 ]] ; then
nvm alias default "$node_v"
fi
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment