Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
change PATH to refer to lib folder
Browse files Browse the repository at this point in the history
update calls to refer to PATH

Signed-off-by: Angus Freudenberg <freudenberg.angus@gmail.com>
  • Loading branch information
afreuden committed Apr 15, 2018
1 parent 281d4c3 commit 4b35638
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions android-sync.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

SOURCE="$( cd "$(dirname "$0")" ; pwd -P )"
PATH=$PATH:/bin:/usr/bin:/usr/local/bin
BASE="$( cd "$(dirname "$0")" ; pwd -P )"
LIB=${BASE}/lib
PATH=$PATH:${BASE}:${LIB}
export PATH

# Default iTunes library location
Expand Down Expand Up @@ -86,7 +87,7 @@ synchronise_music()
#TODO - Determine how to sync music files that have added/updated lyrics ?md5 checksum

echo "Synchronising music....\nDo not unplug your device!"
adb-sync -f -d "${HOST_MUSIC_PATH}/" "${device_music_path}" ||
${LIB}/adb-sync -f -d "${HOST_MUSIC_PATH}/" "${device_music_path}" ||
{
echo "ERROR: A problem occurred while transferring your music. Disengaging..."
disconnect_device
Expand All @@ -102,15 +103,15 @@ synchronise_playlists()
echo "Generating temporary directory..."
playlist=$(mktemp -d) # Temporary folder
echo "Extracting playlists to temporary directory..."
java -jar ${SOURCE}/itunesexport.jar "${HOST_MUSIC_PATH}" -outputDir="${playlist}/" -fileTypes=ALL ||
java -jar ${LIB}/itunesexport.jar "${HOST_MUSIC_PATH}" -outputDir="${playlist}/" -fileTypes=ALL ||
{
echo "ERROR: A problem occurred while exporting your playlists. Disengaging..."
rm -rf ${playlist} # Delete temporary folder
disconnect_device
}
echo
echo "Synchronising playlists...\nDo not unplug your device!"
adb-sync -f -d "${playlist}/" "${device_playlist_path}" ||
${LIB}/adb-sync -f -d "${playlist}/" "${device_playlist_path}" ||
{
echo "A problem occurred while transferring your playlists. Disengaging..."
disconnect_device
Expand Down

0 comments on commit 4b35638

Please sign in to comment.