Files
gitx/scripts/install.sh
T
André Berg 50185248c7 Install gitx (the CLI) via Install.sh.
To do this we use a modified gitx_askpasswd to ask for sudo permissions during build.

Modifications to gitx_askpasswd include:

- Ability to specify the dialog info text (or title) via STDIN or a GITX_ASKPASSWD_DIALOG_TITLE env variable.
  Install.sh uses the env var in 'sudo -A -E' to kindly request the password.
  
  The point of this is to provide a sensible title which lets the user/dev know why he has to enter his password in a dialog that is obviously not from Mac OS X. 

Install.sh will now also create the folder hierarchy needed for the install paths set in Install.xcconfig using 'sudo -A -E' if neccessary (if the folders don't exist).
2010-03-26 11:33:32 +01:00

48 lines
2.1 KiB
Bash
Executable File

#!/bin/sh
# untitled.sh
# GitX
#
# Created by Andre Berg on 19.10.09.
# Copyright 2009 Berg Media. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Installs GitX.app to $CUSTOM_INSTALL_DIR from Install.xcconfig
# Installs gitx to $CLI_CUSTOM_INSTALL_DIR from Install.xcconfig using gitx_askpasswd
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/"
fi
else
echo '$BUILD_STYLE does not contain "Install"... nothing to copy'
fi