diff --git a/bin/beautify-ascii-files.bash b/bin/beautify-ascii-files.bash deleted file mode 100755 index 0829d54..0000000 --- a/bin/beautify-ascii-files.bash +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -e - -function removeNewlineAtEndOfFile() -{ - local -r repositoryFolderPath="${1}" - - find \ - "${repositoryFolderPath}" \ - -type f \ - \( \ - -name 'authorized_keys' -o \ - -name '*.bash' -o \ - -name '*.conf' -o \ - -name 'known_hosts' -o \ - -name 'LICENSE' -o \ - -name '*.md' -o \ - -name '*.profile' \ - \) \ - \( \ - -not -path "${repositoryFolderPath}/.git/*" \ - \) \ - -print \ - -exec bash -c -e ' - for file - do - printf '%s' "$(< "${file}")" > "${file}" - done' bash '{}' \; -} - -function main() -{ - local -r repositoryFolderPath="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - - removeNewlineAtEndOfFile "${repositoryFolderPath}" -} - -main "${@}" \ No newline at end of file diff --git a/bin/tidy-ascii-files.bash b/bin/tidy-ascii-files.bash deleted file mode 100755 index b4db959..0000000 --- a/bin/tidy-ascii-files.bash +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -e - -function main() -{ - "$(dirname "${BASH_SOURCE[0]}")/beautify-ascii-files.bash" - "$(dirname "${BASH_SOURCE[0]}")/validate-bash.bash" -} - -main "${@}" \ No newline at end of file diff --git a/bin/validate-bash.bash b/bin/validate-bash.bash deleted file mode 100755 index 46270ab..0000000 --- a/bin/validate-bash.bash +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -e - -function main() -{ - local -r projectPath="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - - source "${projectPath}/libraries/util.bash" - - local -r command='shellcheck' - - checkExistCommand "${command}" "command '${command}' not found. Run '${projectPath}/cookbooks/shell-check/recipes/install.bash' to install" - - find "${projectPath}" -type f -name '*.bash' -exec "${command}" -e 'SC1090' -s bash '{}' \; -print -} - -main "${@}" \ No newline at end of file diff --git a/cookbooks/brew/recipes/install.bash b/cookbooks/brew/recipes/install.bash index 1c7587b..56df54e 100755 --- a/cookbooks/brew/recipes/install.bash +++ b/cookbooks/brew/recipes/install.bash @@ -18,9 +18,7 @@ function main() { local -r confirm="${1}" - local -r appFolderPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - - source "${appFolderPath}/../../../libraries/util.bash" + source "$(dirname "${BASH_SOURCE[0]}")/../../../libraries/util.bash" checkRequireMacSystem checkRequireNonRootUser diff --git a/cookbooks/brew/recipes/reinstall.bash b/cookbooks/brew/recipes/reinstall.bash index 6cbad09..d94d793 100755 --- a/cookbooks/brew/recipes/reinstall.bash +++ b/cookbooks/brew/recipes/reinstall.bash @@ -4,15 +4,13 @@ function main() { local -r confirm="${1}" - local -r appFolderPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - - source "${appFolderPath}/../../../libraries/util.bash" + source "$(dirname "${BASH_SOURCE[0]}")/../../../libraries/util.bash" checkRequireMacSystem checkRequireNonRootUser - sudo "${appFolderPath}/uninstall.bash" "${confirm}" - "${appFolderPath}/install.bash" "${confirm}" + sudo "$(dirname "${BASH_SOURCE[0]}")/uninstall.bash" "${confirm}" + "$(dirname "${BASH_SOURCE[0]}")/install.bash" "${confirm}" } main "${@}" \ No newline at end of file diff --git a/cookbooks/brew/recipes/uninstall.bash b/cookbooks/brew/recipes/uninstall.bash index c2fadc1..5947c36 100755 --- a/cookbooks/brew/recipes/uninstall.bash +++ b/cookbooks/brew/recipes/uninstall.bash @@ -31,9 +31,7 @@ function main() { local -r confirm="${1}" - local -r appFolderPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - - source "${appFolderPath}/../../../libraries/util.bash" + source "$(dirname "${BASH_SOURCE[0]}")/../../../libraries/util.bash" checkRequireMacSystem checkRequireRootUser diff --git a/tools/install-brew-applications.bash b/tools/install-brew-applications.bash index b3c7304..ec1715e 100755 --- a/tools/install-brew-applications.bash +++ b/tools/install-brew-applications.bash @@ -34,7 +34,7 @@ function installDependencies() { if [[ "$(existCommand 'brew')" = 'false' ]] then - "${APP_FOLDER_PATH}/../cookbooks/brew/recipes/install.bash" 'true' + "$(dirname "${BASH_SOURCE[0]}")/../cookbooks/brew/recipes/install.bash" 'true' fi } @@ -51,21 +51,21 @@ function installBrewPackage() # Pre Install - if [[ -f "${APP_FOLDER_PATH}/../cookbooks/${packageName}/recipes/pre-install.bash" ]] + if [[ -f "$(dirname "${BASH_SOURCE[0]}")/../cookbooks/${packageName}/recipes/pre-install.bash" ]] then - sudo "${APP_FOLDER_PATH}/../cookbooks/${packageName}/recipes/pre-install.bash" + sudo "$(dirname "${BASH_SOURCE[0]}")/../cookbooks/${packageName}/recipes/pre-install.bash" fi # Install - brew "${packageType[@]}" reinstall "${packageName}" - displayVersion "$(brew list --versions "${packageName}")" + brew ${packageType[@]} reinstall "${packageName}" + displayVersion "$(brew ${packageType[@]} list --versions "${packageName}")" # Post Install - if [[ -f "${APP_FOLDER_PATH}/../cookbooks/${packageName}/recipes/post-install.bash" ]] + if [[ -f "$(dirname "${BASH_SOURCE[0]}")/../cookbooks/${packageName}/recipes/post-install.bash" ]] then - sudo "${APP_FOLDER_PATH}/../cookbooks/${packageName}/recipes/post-install.bash" + sudo "$(dirname "${BASH_SOURCE[0]}")/../cookbooks/${packageName}/recipes/post-install.bash" fi done } @@ -101,9 +101,7 @@ function install() function main() { - APP_FOLDER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - - source "${APP_FOLDER_PATH}/../libraries/util.bash" + source "$(dirname "${BASH_SOURCE[0]}")/../libraries/util.bash" # Parsing Command Arguments