Skip to content

Instantly share code, notes, and snippets.

@jgilfelt
Created September 13, 2012 15:23
Show Gist options
  • Save jgilfelt/3715056 to your computer and use it in GitHub Desktop.
Save jgilfelt/3715056 to your computer and use it in GitHub Desktop.
Toggle Google/Amazon Android map imports
#!/bin/bash
A_IMPORT="import com.amazon.geo.maps"
G_IMPORT="import com.google.android.maps"
A_VIEW="com.amazon.geo.maps.MapView"
G_VIEW="com.google.android.maps.MapView"
if [ "$1" = "a" ]; then
FR=$G_IMPORT
TO=$A_IMPORT
FR1=$G_VIEW
TO1=$A_VIEW
else
FR=$A_IMPORT
TO=$G_IMPORT
FR1=$A_VIEW
TO1=$G_VIEW
fi
find ./src -name "*.java" -print | xargs sed -i "" "s/$FR/$TO/g"
find ./res/layout -name "*.xml" -print | xargs sed -i "" "s/$FR1/$TO1/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment