From 35d858363a88f1d985ba36cf0e18de6ab0ccfcd1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 17 Aug 2016 22:58:15 +0200 Subject: move .bashrc_* to .bash_utils/ --- .appdata/appdata.sh | 52 ++++++++++++++++++++++ .bash_utils/cxx.sh | 118 +++++++++++++++++++++++++++++++++++++++++++++++++ .bash_utils/distr.sh | 29 ++++++++++++ .bash_utils/git.sh | 102 ++++++++++++++++++++++++++++++++++++++++++ .bash_utils/netwrix.sh | 38 ++++++++++++++++ .bash_utils/text.sh | 27 +++++++++++ .bashrc | 11 +++-- .bashrc_cxx | 118 ------------------------------------------------- .bashrc_distr | 29 ------------ .bashrc_git | 102 ------------------------------------------ .bashrc_netwrix | 38 ---------------- .bashrc_text | 27 ----------- .bashrc_third_party | 52 ---------------------- 13 files changed, 371 insertions(+), 372 deletions(-) create mode 100644 .appdata/appdata.sh create mode 100644 .bash_utils/cxx.sh create mode 100644 .bash_utils/distr.sh create mode 100644 .bash_utils/git.sh create mode 100644 .bash_utils/netwrix.sh create mode 100644 .bash_utils/text.sh delete mode 100644 .bashrc_cxx delete mode 100644 .bashrc_distr delete mode 100644 .bashrc_git delete mode 100644 .bashrc_netwrix delete mode 100644 .bashrc_text delete mode 100644 .bashrc_third_party diff --git a/.appdata/appdata.sh b/.appdata/appdata.sh new file mode 100644 index 0000000..58cc7da --- /dev/null +++ b/.appdata/appdata.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +ensure_symlinks_enabled() { + case "${CYGWIN:-}" in + *winsymlinks:native*) ;; + *winsymlinks:nativestrict*) ;; + + *) + echo "${FUNCNAME[0]}: native Windows symlinks aren't enabled in Cygwin" >&2 + return 1 + ;; + esac +} + +symlink_preferences() ( + set -o errexit -o nounset -o pipefail + + if [ "$#" -ne 2 ]; then + echo "usage: ${FUNCNAME[0]} SRC_DIR DEST_DIR" >&2 + return 1 + fi + + ensure_symlinks_enabled + + local src_dir="$1" + local dest_dir="$2" + + mkdir -p "$dest_dir" + + find "$src_dir" -maxdepth 1 -type f -exec ln --force -s {} "$dest_dir" \; +) + +symlink_sublime_preferences() ( + set -o errexit -o nounset -o pipefail + + symlink_preferences \ + "$HOME/.appdata/Sublime Text 3" \ + "$APPDATA/Sublime Text 3/Packages/User" +) + +symlink_ghc_preferences() ( + set -o errexit -o nounset -o pipefail + + symlink_preferences \ + "$HOME/.appdata/ghc" \ + "$APPDATA/ghc" +) diff --git a/.bash_utils/cxx.sh b/.bash_utils/cxx.sh new file mode 100644 index 0000000..49d4549 --- /dev/null +++ b/.bash_utils/cxx.sh @@ -0,0 +1,118 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +runc_flags=('-Wall' '-Wextra') + +runc() ( + set -o errexit -o nounset -o pipefail + + local -a c_flags=("${runc_flags[@]+"${runc_flags[@]}"}") + local -a src_files + local -a prog_flags + + while [ "$#" -gt 0 ]; do + case "$1" in + -c|--c-flags) + if [ "$#" -le 1 ]; then + echo "${FUNCNAME[0]}: missing argument for parameter: $1" >&2 + return 1 + fi + shift + c_flags+=("$1") + shift + ;; + + -h|--help) + echo "usage: ${FUNCNAME[0]} [-h|--help] [-c|--c-flags FLAG]" + return 0 + ;; + + --) + shift + break + ;; + + *) + src_files+=("$( realpath "$1" )") + shift + ;; + esac + done + + prog_flags=("$@") + + local build_dir + build_dir="$( mktemp --directory )" + + trap "$( printf 'popd > /dev/null && rm -rf %q' "$build_dir" )" 0 + pushd "$build_dir" > /dev/null + + local output_name + output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" + + gcc -o "$output_name" \ + "${c_flags[@]+"${c_flags[@]}"}" \ + "${src_files[@]+"${src_files[@]}"}" + + "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" +) + +runcxx_flags=('-Wall' '-Wextra' '-std=c++14') + +runcxx() ( + set -o errexit -o nounset -o pipefail + + local -a cxx_flags=("${runcxx_flags[@]+"${runcxx_flags[@]}"}") + local -a src_files + local -a prog_flags + + while [ "$#" -gt 0 ]; do + case "$1" in + -c|--cxx-flags) + if [ "$#" -le 1 ]; then + echo "${FUNCNAME[0]}: missing argument for parameter: $1" >&2 + return 1 + fi + shift + cxx_flags+=("$1") + shift + ;; + + -h|--help) + echo "usage: ${FUNCNAME[0]} [-h|--help] [-c|--cxx-flags FLAG]" + return 0 + ;; + + --) + shift + break + ;; + + *) + src_files+=("$( realpath "$1" )") + shift + ;; + esac + done + + prog_flags=("$@") + + local build_dir + build_dir="$( mktemp --directory )" + + trap "$( printf 'popd > /dev/null && rm -rf %q' "$build_dir" )" 0 + pushd "$build_dir" > /dev/null + + local output_name + output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" + + g++ -o "$output_name" \ + "${cxx_flags[@]+"${cxx_flags[@]}"}" \ + "${src_files[@]+"${src_files[@]}"}" + + "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" +) diff --git a/.bash_utils/distr.sh b/.bash_utils/distr.sh new file mode 100644 index 0000000..8e7b84c --- /dev/null +++ b/.bash_utils/distr.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +readonly checksums_path='sha1sums.txt' + +update_checksums() { + sha1sum -- "$@" > "$checksums_path" +} + +update_checksums_distr() ( + set -o errexit -o nounset -o pipefail + + local -a paths + local path + + while IFS= read -d '' -r path; do + paths+=("$path") + done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 ) + + update_checksums "${paths[@]+"${paths[@]}"}" +) + +verify_checksums() { + sha1sum --check "$checksums_path" +} diff --git a/.bash_utils/git.sh b/.bash_utils/git.sh new file mode 100644 index 0000000..54e50f6 --- /dev/null +++ b/.bash_utils/git.sh @@ -0,0 +1,102 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +list_repo_files() ( + set -o errexit -o nounset -o pipefail + + local -a cmd=(git ls-files) + + while [ "$#" -gt 0 ]; do + case "$1" in + -z|-0) + cmd+=(-z) + shift + ;; + + -h|--help) + echo "usage: ${FUNCNAME[0]} [-h|--help] [-z|-0]" + return 0 + ;; + + *) + echo "${FUNCNAME[0]}: unrecognized parameter: $1" >&2 + return 1 + ;; + esac + done + + eval "${cmd[@]+"${cmd[@]}"}" +) + +list_repo_dirs() ( + set -o errexit -o nounset -o pipefail + + local -a cmd=(git ls-tree -d -r) + + while [ "$#" -gt 0 ]; do + case "$1" in + -z|-0) + cmd+=(-z) + shift + ;; + + -h|--help) + echo "usage: ${FUNCNAME[0]} [-h|--help] [-z|-0]" + return 0 + ;; + + *) + echo "${FUNCNAME[0]}: unrecognized parameter: $1" >&2 + return 1 + ;; + esac + done + + cmd+=(--name-only HEAD) + + eval "${cmd[@]+"${cmd[@]}"}" +) + +tighten_repo_security() ( + set -o errexit -o nounset -o pipefail + + list_repo_files -z | xargs -0 chmod 0600 + list_repo_dirs -z | xargs -0 chmod 0700 + chmod 0700 .git +) + +backup_repo() ( + set -o errexit -o nounset -o pipefail + + local repo_dir + repo_dir="$( realpath . )" + local repo_name + repo_name="$( basename "$repo_dir" )" + local backup_dir="$repo_dir" + + if [ $# -eq 1 ]; then + backup_dir="$1" + elif [ $# -gt 1 ]; then + echo "usage: ${FUNCNAME[0]} [BACKUP_DIR]" >&2 + exit 1 + fi + + local zip_name + zip_name="${repo_name}_$( date -u +'%Y%m%dT%H%M%S' ).zip" + + git archive \ + --format=zip -9 \ + --output="$backup_dir/$zip_name" \ + --remote="$repo_dir" \ + HEAD +) + +backup_repo_dropbox() ( + set -o errexit -o nounset -o pipefail + + backup_repo "$USERPROFILE/Dropbox/backups" +) diff --git a/.bash_utils/netwrix.sh b/.bash_utils/netwrix.sh new file mode 100644 index 0000000..0f79937 --- /dev/null +++ b/.bash_utils/netwrix.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +source .bash_utils/git.sh || return +source .bash_utils/text.sh || return + +export nwx_host=172.28.10.2 +export nwx_dev2=172.28.19.60 +export nwx_dev3=172.28.19.61 + +lint_webapi() ( + set -o errexit -o nounset -o pipefail + + local root_dir='/cygdrive/c/Netwrix Auditor/CurrentVersion-AuditCore-Dev/AuditCore/Sources' + + local -a paths + local path + + cd "$root_dir/Configuration" + while IFS= read -d '' -r path; do + paths+=("$path") + done < <( find . -type f -\( -iname 'WebAPI*.acinc' -o -iname 'WebAPI*.acconf' -\) -print0 ) + + cd "$root_dir/Subsystems/PublicAPI" + while IFS= read -d '' -r path; do + paths+=("$path") + done < <( find . -type f -\( -iname '*.cpp' -o -iname '*.h' -\) -print0 ) + + doslint "${paths[@]+"${paths[@]}"}" +) + +backup_repo_nwx() { + backup_repo '//spbfs02/P/Personal/Egor Tensin' +} diff --git a/.bash_utils/text.sh b/.bash_utils/text.sh new file mode 100644 index 0000000..5a678ee --- /dev/null +++ b/.bash_utils/text.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Cygwin configuration files" project. +# For details, see https://github.com/egor-tensin/cygwin-home. +# Distributed under the MIT License. + +alias dos2eol='sed --binary --in-place '"'"'s/\(\r\?\)$//'"'" +alias eol2dos='sed --binary --in-place '"'"'s/\r\?$/\r/'"'" + +alias trim='sed --binary --in-place '"'"'s/[[:blank:]]*\(\r\?\)$/\1/'"'" + +alias trimeol='sed --binary --in-place -e :a -e '"'"'/^\n*$/{$d;N;ba}'"'" +alias trimdoseol='sed --binary --in-place -e :a -e '"'"'/^\(\r\n\)*\r$/{$d;N;ba}'"'" + +alias eol='sed --binary --in-place '"'"'$a\'"'" +alias doseol='sed --binary --in-place '"'"'$s/\r\?$/\r/;a\'"'" + +alias trimbom='sed --binary --in-place '"'"'1 s/^\xef\xbb\xbf//'"'" + +lint() { + trim "$@" && trimeol "$@" && eol "$@" +} + +doslint() { + trim "$@" && trimdoseol "$@" && doseol "$@" +} diff --git a/.bashrc b/.bashrc index 05e1738..c425a79 100644 --- a/.bashrc +++ b/.bashrc @@ -211,9 +211,8 @@ alias list_packages='cygcheck -cd' export PYTHONSTARTUP="$HOME/.pythonrc" -[ -f '.bashrc_cxx' ] && source .bashrc_cxx -[ -f '.bashrc_distr' ] && source .bashrc_distr -[ -f '.bashrc_git' ] && source .bashrc_git -[ -f '.bashrc_netwrix' ] && source .bashrc_netwrix -[ -f '.bashrc_text' ] && source .bashrc_text -[ -f ".bashrc_third_party" ] && source .bashrc_third_party +[ -f '.bash_utils/cxx.sh' ] && source .bash_utils/cxx.sh +[ -f '.bash_utils/distr.sh' ] && source .bash_utils/distr.sh +[ -f '.bash_utils/git.sh' ] && source .bash_utils/git.sh +[ -f '.bash_utils/netwrix.sh' ] && source .bash_utils/netwrix.sh +[ -f '.bash_utils/text.sh' ] && source .bash_utils/text.sh diff --git a/.bashrc_cxx b/.bashrc_cxx deleted file mode 100644 index 49d4549..0000000 --- a/.bashrc_cxx +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -runc_flags=('-Wall' '-Wextra') - -runc() ( - set -o errexit -o nounset -o pipefail - - local -a c_flags=("${runc_flags[@]+"${runc_flags[@]}"}") - local -a src_files - local -a prog_flags - - while [ "$#" -gt 0 ]; do - case "$1" in - -c|--c-flags) - if [ "$#" -le 1 ]; then - echo "${FUNCNAME[0]}: missing argument for parameter: $1" >&2 - return 1 - fi - shift - c_flags+=("$1") - shift - ;; - - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-c|--c-flags FLAG]" - return 0 - ;; - - --) - shift - break - ;; - - *) - src_files+=("$( realpath "$1" )") - shift - ;; - esac - done - - prog_flags=("$@") - - local build_dir - build_dir="$( mktemp --directory )" - - trap "$( printf 'popd > /dev/null && rm -rf %q' "$build_dir" )" 0 - pushd "$build_dir" > /dev/null - - local output_name - output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" - - gcc -o "$output_name" \ - "${c_flags[@]+"${c_flags[@]}"}" \ - "${src_files[@]+"${src_files[@]}"}" - - "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" -) - -runcxx_flags=('-Wall' '-Wextra' '-std=c++14') - -runcxx() ( - set -o errexit -o nounset -o pipefail - - local -a cxx_flags=("${runcxx_flags[@]+"${runcxx_flags[@]}"}") - local -a src_files - local -a prog_flags - - while [ "$#" -gt 0 ]; do - case "$1" in - -c|--cxx-flags) - if [ "$#" -le 1 ]; then - echo "${FUNCNAME[0]}: missing argument for parameter: $1" >&2 - return 1 - fi - shift - cxx_flags+=("$1") - shift - ;; - - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-c|--cxx-flags FLAG]" - return 0 - ;; - - --) - shift - break - ;; - - *) - src_files+=("$( realpath "$1" )") - shift - ;; - esac - done - - prog_flags=("$@") - - local build_dir - build_dir="$( mktemp --directory )" - - trap "$( printf 'popd > /dev/null && rm -rf %q' "$build_dir" )" 0 - pushd "$build_dir" > /dev/null - - local output_name - output_name="$( mktemp --tmpdir=. "${FUNCNAME[0]}XXX.exe" )" - - g++ -o "$output_name" \ - "${cxx_flags[@]+"${cxx_flags[@]}"}" \ - "${src_files[@]+"${src_files[@]}"}" - - "$output_name" "${prog_flags[@]+"${prog_flags[@]}"}" -) diff --git a/.bashrc_distr b/.bashrc_distr deleted file mode 100644 index 8e7b84c..0000000 --- a/.bashrc_distr +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -readonly checksums_path='sha1sums.txt' - -update_checksums() { - sha1sum -- "$@" > "$checksums_path" -} - -update_checksums_distr() ( - set -o errexit -o nounset -o pipefail - - local -a paths - local path - - while IFS= read -d '' -r path; do - paths+=("$path") - done < <( find . -type f -\( -iname '*.exe' -o -iname '*.iso' -\) -print0 ) - - update_checksums "${paths[@]+"${paths[@]}"}" -) - -verify_checksums() { - sha1sum --check "$checksums_path" -} diff --git a/.bashrc_git b/.bashrc_git deleted file mode 100644 index 54e50f6..0000000 --- a/.bashrc_git +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -list_repo_files() ( - set -o errexit -o nounset -o pipefail - - local -a cmd=(git ls-files) - - while [ "$#" -gt 0 ]; do - case "$1" in - -z|-0) - cmd+=(-z) - shift - ;; - - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-z|-0]" - return 0 - ;; - - *) - echo "${FUNCNAME[0]}: unrecognized parameter: $1" >&2 - return 1 - ;; - esac - done - - eval "${cmd[@]+"${cmd[@]}"}" -) - -list_repo_dirs() ( - set -o errexit -o nounset -o pipefail - - local -a cmd=(git ls-tree -d -r) - - while [ "$#" -gt 0 ]; do - case "$1" in - -z|-0) - cmd+=(-z) - shift - ;; - - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-z|-0]" - return 0 - ;; - - *) - echo "${FUNCNAME[0]}: unrecognized parameter: $1" >&2 - return 1 - ;; - esac - done - - cmd+=(--name-only HEAD) - - eval "${cmd[@]+"${cmd[@]}"}" -) - -tighten_repo_security() ( - set -o errexit -o nounset -o pipefail - - list_repo_files -z | xargs -0 chmod 0600 - list_repo_dirs -z | xargs -0 chmod 0700 - chmod 0700 .git -) - -backup_repo() ( - set -o errexit -o nounset -o pipefail - - local repo_dir - repo_dir="$( realpath . )" - local repo_name - repo_name="$( basename "$repo_dir" )" - local backup_dir="$repo_dir" - - if [ $# -eq 1 ]; then - backup_dir="$1" - elif [ $# -gt 1 ]; then - echo "usage: ${FUNCNAME[0]} [BACKUP_DIR]" >&2 - exit 1 - fi - - local zip_name - zip_name="${repo_name}_$( date -u +'%Y%m%dT%H%M%S' ).zip" - - git archive \ - --format=zip -9 \ - --output="$backup_dir/$zip_name" \ - --remote="$repo_dir" \ - HEAD -) - -backup_repo_dropbox() ( - set -o errexit -o nounset -o pipefail - - backup_repo "$USERPROFILE/Dropbox/backups" -) diff --git a/.bashrc_netwrix b/.bashrc_netwrix deleted file mode 100644 index c20b32e..0000000 --- a/.bashrc_netwrix +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -source .bashrc_git || return -source .bashrc_text || return - -export nwx_host=172.28.10.2 -export nwx_dev2=172.28.19.60 -export nwx_dev3=172.28.19.61 - -lint_webapi() ( - set -o errexit -o nounset -o pipefail - - local root_dir='/cygdrive/c/Netwrix Auditor/CurrentVersion-AuditCore-Dev/AuditCore/Sources' - - local -a paths - local path - - cd "$root_dir/Configuration" - while IFS= read -d '' -r path; do - paths+=("$path") - done < <( find . -type f -\( -iname 'WebAPI*.acinc' -o -iname 'WebAPI*.acconf' -\) -print0 ) - - cd "$root_dir/Subsystems/PublicAPI" - while IFS= read -d '' -r path; do - paths+=("$path") - done < <( find . -type f -\( -iname '*.cpp' -o -iname '*.h' -\) -print0 ) - - doslint "${paths[@]+"${paths[@]}"}" -) - -backup_repo_nwx() { - backup_repo '//spbfs02/P/Personal/Egor Tensin' -} diff --git a/.bashrc_text b/.bashrc_text deleted file mode 100644 index 5a678ee..0000000 --- a/.bashrc_text +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -alias dos2eol='sed --binary --in-place '"'"'s/\(\r\?\)$//'"'" -alias eol2dos='sed --binary --in-place '"'"'s/\r\?$/\r/'"'" - -alias trim='sed --binary --in-place '"'"'s/[[:blank:]]*\(\r\?\)$/\1/'"'" - -alias trimeol='sed --binary --in-place -e :a -e '"'"'/^\n*$/{$d;N;ba}'"'" -alias trimdoseol='sed --binary --in-place -e :a -e '"'"'/^\(\r\n\)*\r$/{$d;N;ba}'"'" - -alias eol='sed --binary --in-place '"'"'$a\'"'" -alias doseol='sed --binary --in-place '"'"'$s/\r\?$/\r/;a\'"'" - -alias trimbom='sed --binary --in-place '"'"'1 s/^\xef\xbb\xbf//'"'" - -lint() { - trim "$@" && trimeol "$@" && eol "$@" -} - -doslint() { - trim "$@" && trimdoseol "$@" && doseol "$@" -} diff --git a/.bashrc_third_party b/.bashrc_third_party deleted file mode 100644 index 58cc7da..0000000 --- a/.bashrc_third_party +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -ensure_symlinks_enabled() { - case "${CYGWIN:-}" in - *winsymlinks:native*) ;; - *winsymlinks:nativestrict*) ;; - - *) - echo "${FUNCNAME[0]}: native Windows symlinks aren't enabled in Cygwin" >&2 - return 1 - ;; - esac -} - -symlink_preferences() ( - set -o errexit -o nounset -o pipefail - - if [ "$#" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} SRC_DIR DEST_DIR" >&2 - return 1 - fi - - ensure_symlinks_enabled - - local src_dir="$1" - local dest_dir="$2" - - mkdir -p "$dest_dir" - - find "$src_dir" -maxdepth 1 -type f -exec ln --force -s {} "$dest_dir" \; -) - -symlink_sublime_preferences() ( - set -o errexit -o nounset -o pipefail - - symlink_preferences \ - "$HOME/.appdata/Sublime Text 3" \ - "$APPDATA/Sublime Text 3/Packages/User" -) - -symlink_ghc_preferences() ( - set -o errexit -o nounset -o pipefail - - symlink_preferences \ - "$HOME/.appdata/ghc" \ - "$APPDATA/ghc" -) -- cgit v1.2.3