Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Cleaning up console color codes and whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbouwer committed Nov 2, 2014
1 parent 8bf800a commit 4ba541e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/shims/scriptcs
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#!/bin/bash

SCRIPT_PATH="${BASH_SOURCE[0]%/*}" # /.svm/shims
SVM_PATH=${SCRIPT_PATH%/shims} # /.svm/
VERSIONS_PATH="$SVM_PATH/versions" # /.svm/versions
VERSION_FILE_PATH="$SVM_PATH/version" # /.svm/version
SCRIPT_PATH="${BASH_SOURCE[0]%/*}" # /.svm/shims
SVM_PATH=${SCRIPT_PATH%/shims} # /.svm/
VERSIONS_PATH="$SVM_PATH/versions" # /.svm/versions
VERSION_FILE_PATH="$SVM_PATH/version" # /.svm/version

#
# helper functions
#

_svm_error_message() {
local message="$1"
echo -e "\e[41m[SVM] $message\e[0m"
local message="$1"
echo -e "\033[41m $message \033[0m"
}

_svm_trim_string() {
local string="$1"
string="${string##*( )}" # trim leading whitespace
string="${string%%*( )}" # trim trailing whitespace
echo $string
local string="$1"
string="${string##*( )}" # trim leading whitespace
string="${string%%*( )}" # trim trailing whitespace
echo $string
}

_svm_get_active_version() {
local activeVersion=""
local activeVersion=""

if [ -f "$VERSION_FILE_PATH" ]; then
activeVersion=`cat $VERSION_FILE_PATH`
activeVersion=$(_svm_trim_string "$activeVersion")
fi
if [ -f "$VERSION_FILE_PATH" ]; then
activeVersion=`cat $VERSION_FILE_PATH`
activeVersion=$(_svm_trim_string "$activeVersion")
fi

echo $activeVersion
echo $activeVersion
}

_svm_get_scriptcs_executable() {
local version="$1"
local version="$1"
local scriptcs="$VERSIONS_PATH/$version/scriptcs.exe"
echo $scriptcs
}
Expand Down

0 comments on commit 4ba541e

Please sign in to comment.