Skip to content

Instantly share code, notes, and snippets.

@prashantsharma
Forked from subtleGradient/appify
Created April 25, 2020 17:32
Show Gist options
  • Save prashantsharma/397d730b0045b56508ab5a5dbef71853 to your computer and use it in GitHub Desktop.
Save prashantsharma/397d730b0045b56508ab5a5dbef71853 to your computer and use it in GitHub Desktop.

Revisions

  1. @subtleGradient subtleGradient revised this gist Nov 12, 2010. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions appify
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env bash
    #
    # url : https://gist.github.com/672684
    # version : 2.0.1
    # version : 2.0.2
    # name : appify
    # description : Create the simplest possible mac app from a shell script.
    # usage : cat my-script.sh | appify MyApp
    @@ -20,8 +20,10 @@ mkdir -p "$APPNAME.app/Contents/MacOS"
    touch "$APPNAME.app/Contents/MacOS/$APPNAME"
    chmod +x "$APPNAME.app/Contents/MacOS/$APPNAME"

    while read SCRIPT_SOURCE_LINE; do
    echo "$SCRIPT_SOURCE_LINE" >> "$APPNAME.app/Contents/MacOS/$APPNAME"
    DONE=false
    until $DONE ;do
    read || DONE=true
    echo "$REPLY" >> "$APPNAME.app/Contents/MacOS/$APPNAME"
    done

    echo "$PWD/$APPNAME.app"
  2. @subtleGradient subtleGradient revised this gist Nov 11, 2010. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions appify
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env bash
    #
    # url : https://gist.github.com/672684
    # version : 2.0
    # version : 2.0.1
    # name : appify
    # description : Create the simplest possible mac app from a shell script.
    # usage : cat my-script.sh | appify MyApp
    @@ -11,7 +11,7 @@
    APPNAME=${1:-Untitled}

    if [[ -a "$APPNAME.app" ]]; then
    echo "App already exists" >&2
    echo "App already exists :'(" >&2
    echo "$PWD/$APPNAME.app"
    exit 1
    fi
  3. @subtleGradient subtleGradient revised this gist Nov 11, 2010. 1 changed file with 20 additions and 7 deletions.
    27 changes: 20 additions & 7 deletions appify
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,27 @@
    #!/usr/bin/env bash
    # Create a new super simple mac app
    # Platform: Mac OS X
    # Author: Thomas Aylott <[email protected]>
    #
    # url : https://gist.github.com/672684
    # version : 2.0
    # name : appify
    # description : Create the simplest possible mac app from a shell script.
    # usage : cat my-script.sh | appify MyApp
    # platform : Mac OS X
    # author : Thomas Aylott <[email protected]>

    APPNAME=${1:-Untitled}

    if [[ -a "$APPNAME.app" ]]; then
    echo "App already exists" >&2
    echo "$PWD/$APPNAME.app"
    exit 1
    fi

    mkdir -p "$APPNAME.app/Contents/MacOS"
    cat > "$APPNAME.app/Contents/MacOS/$APPNAME" <<EOF
    #!/usr/bin/osascript
    say "Hello"
    EOF
    touch "$APPNAME.app/Contents/MacOS/$APPNAME"
    chmod +x "$APPNAME.app/Contents/MacOS/$APPNAME"

    while read SCRIPT_SOURCE_LINE; do
    echo "$SCRIPT_SOURCE_LINE" >> "$APPNAME.app/Contents/MacOS/$APPNAME"
    done

    echo "$PWD/$APPNAME.app"
  4. @subtleGradient subtleGradient created this gist Nov 11, 2010.
    14 changes: 14 additions & 0 deletions appify
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/usr/bin/env bash
    # Create a new super simple mac app
    # Platform: Mac OS X
    # Author: Thomas Aylott <[email protected]>

    APPNAME=${1:-Untitled}

    mkdir -p "$APPNAME.app/Contents/MacOS"
    cat > "$APPNAME.app/Contents/MacOS/$APPNAME" <<EOF
    #!/usr/bin/osascript
    say "Hello"
    EOF
    chmod +x "$APPNAME.app/Contents/MacOS/$APPNAME"
    echo "$PWD/$APPNAME.app"