Permalink
Browse files

Make building and installing possible right from within Xcode.

Edit install.sh to use gitx_askpasswd so that a password dialog is shown whenever
sudo is used in the install script.

Also split the install logic in install.sh based on BUILD_STYLE so that 
installing GitX and gitx (CLI) is possible each on its own.
  • Loading branch information...
1 parent d76072f commit 8e55c30b38062d39d0d5b9b804dc55e13e144769 @andreberg andreberg committed Apr 5, 2010
Showing with 26 additions and 17 deletions.
  1. +26 −17 scripts/install.sh
View
@@ -25,23 +25,32 @@ export SUDO_ASKPASS="$BUILT_PRODUCTS_DIR/gitx_askpasswd"
export GITX_ASKPASSWD_DIALOG_TITLE="Please enter sudo pass for Install"
if [[ $BUILD_STYLE =~ "Install" ]]; then
- if [[ ! -d "$CUSTOM_INSTALL_DIR" ]]; then
- echo "$CUSTOM_INSTALL_DIR doesn't exist. Will create it for you..."
- sudo -A -E /bin/mkdir -p "${CUSTOM_INSTALL_DIR}"
- fi
- if [[ ! -d "$CLI_CUSTOM_INSTALL_DIR" ]]; then
- echo "$CLI_CUSTOM_INSTALL_DIR doesn't exist. Will create it for you..."
- sudo -A -E /bin/mkdir -p "${CLI_CUSTOM_INSTALL_DIR}"
- fi
- echo "Installing ${FULL_PRODUCT_NAME} to ${CUSTOM_INSTALL_DIR}... "
- echo "Installing gitx command line tool to ${CLI_CUSTOM_INSTALL_DIR}..."
- echo "(switch to build config other than Install to avoid)"
- if [[ -e /opt/local/bin/rsync ]]; then
- /opt/local/bin/rsync -rlHEptog --xattrs --acls "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" "$CUSTOM_INSTALL_DIR/"
- sudo -A -E /opt/local/bin/rsync -rlHEptog --xattrs --acls "$BUILT_PRODUCTS_DIR/gitx" "$CLI_CUSTOM_INSTALL_DIR/"
- else
- /usr/bin/rsync -rlHEptog "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" "$CUSTOM_INSTALL_DIR/"
- sudo -A -E /usr/bin/rsync -rlHEptog "$BUILT_PRODUCTS_DIR/gitx" "$CLI_CUSTOM_INSTALL_DIR/"
+ if [[ $TARGET_NAME =~ "$PRODUCT_NAME" ]]; then
+ # install GitX
+ echo "Installing ${FULL_PRODUCT_NAME} to ${CUSTOM_INSTALL_DIR}... "
+ echo "(switch to build config other than Install to avoid)"
+ if [[ ! -d "$CUSTOM_INSTALL_DIR" ]]; then
+ echo "$CUSTOM_INSTALL_DIR doesn't exist. Will create it for you..."
+ sudo -A -E /bin/mkdir -p "${CUSTOM_INSTALL_DIR}"
+ fi
+ if [[ -e /opt/local/bin/rsync ]]; then
+ /opt/local/bin/rsync -rlHEptog --xattrs --acls "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" "$CUSTOM_INSTALL_DIR/"
+ else
+ /usr/bin/rsync -rlHEptog "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME" "$CUSTOM_INSTALL_DIR/"
+ fi
+ elif [[ $TARGET_NAME =~ "cli tool" ]]; then
+ # install cli tool
+ echo "Installing gitx command line tool to ${CLI_CUSTOM_INSTALL_DIR}..."
+ echo "(switch to build config other than Install to avoid)"
+ if [[ ! -d "$CLI_CUSTOM_INSTALL_DIR" ]]; then
+ echo "$CLI_CUSTOM_INSTALL_DIR doesn't exist. Will create it for you..."
+ sudo -A -E /bin/mkdir -p "${CLI_CUSTOM_INSTALL_DIR}"
+ fi
+ if [[ -e /opt/local/bin/rsync ]]; then
+ sudo -A -E /opt/local/bin/rsync -rlHEptog --xattrs --acls "$BUILT_PRODUCTS_DIR/gitx" "$CLI_CUSTOM_INSTALL_DIR/"
+ else
+ sudo -A -E /usr/bin/rsync -rlHEptog "$BUILT_PRODUCTS_DIR/gitx" "$CLI_CUSTOM_INSTALL_DIR/"
+ fi
fi
else
echo '$BUILD_STYLE does not contain "Install"... nothing to copy'

0 comments on commit 8e55c30

Please sign in to comment.