Skip to content

Instantly share code, notes, and snippets.

@GongT
Created May 5, 2018 15:24
Show Gist options
  • Save GongT/7f12dd4a4ff2959c0439f914364b58b5 to your computer and use it in GitHub Desktop.
Save GongT/7f12dd4a4ff2959c0439f914364b58b5 to your computer and use it in GitHub Desktop.
cygwin install new package
#!/bin/bash
LOCAL_REPO='http://mirrors.aliyun.com/cygwin/'
LOCAL_PACKAGE_DIR='A:/cygwin-repo'
if [ ! -e /setup-x86_64.exe ]; then
if command -v wget &>/dev/null ; then
wget -c "http://cygwin.org/setup-x86_64.exe" -O /setup-x86_64.exe
else
echo "No setup-x86_64.exe, and no wget." >&2
exit 1
fi
fi
function join_by {
local IFS="$1"
shift
echo "$*"
}
# --prune-install \
/setup-x86_64.exe \
--local-package-dir "${LOCAL_PACKAGE_DIR}" \
--root "$(cygpath -w /)" \
--site "${LOCAL_REPO}" \
--upgrade-also \
--quiet-mode \
--packages \
"$(join_by , "${@}")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment