1234567891011121314151617181920212223 |
- #!/usr/bin/env bash
- source "${SNAP}/env/vars"
- is_root || echo "You might experience some issues with running this as a user. Consider using sudo."
- if [ "$(basename ${1})" == "code-server" ]; then
- ARGS=(--config "${VSCS_CONFIG}")
- ARGS+=(--user-data-dir "${VSCS_UDD}")
- ARGS+=(--extensions-dir "${VSCS_EXT}")
- ARGS+=("${VSCS_USD}")
- set -- "$@" "${ARGS[@]}"
- fi
- if [ ! -d "${VSCS_SSH}" ]; then
- mkdir --mode=0700 "${VSCS_SSH}"
- touch "${VSCS_SSH}/config"
- chmod 0644 "${VSCS_SSH}/config"
- echo "alias ssh-keygen='ssh-keygen -f \"${VSCS_SSH}/id_rsa\"'" >> "${SNAP_USER_DATA}/.bashrc"
- git config --global core.sshCommand "ssh -i \"${VSCS_SSH}/id_rsa\" -F \"${VSCS_SSH}/config\" -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\"${VSCS_SSH}/known_hosts\""
- fi
- exec $@
|