Skip to content

Neved4/apputils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macOS POSIX.1%2D2017 Shell Script Fish Shell

apputils - Find macOS app paths! 🚀

apputils is a collection of shell functions to find application bundle paths.

Available for POSIX shells (e.g. bash, ksh, zsh) and fish. Built on mdfind.

Getting Started

Note

This utility is meant to only be run on macOS.

Prerequisites

Before using apputils, ensure you have:

  • A POSIX compatible shell, or fish.
  • macOS with mdfind command available.

Installation

To directly source the scripts and use their functions in your environment:

$ . /path/to/repo/app.sh
$ appdir 'Docker'

If you have brew installed, just run:

$ brew install Neved4/tap/apputils

Otherwise, clone the repository or download the script files directly:

$ git clone https://github.com/Neved4/apputils.git

Navigate with cd into the project directory and then run:

$ ./install.sh

Usage

The following options are available:

usage: app command [options] <app>

Options:
    -i  Perform case-insensitive matching

Commands:
    list  List all installed apps.
    find  List application full path.
    dir   List application parent directory.

When added to your shell profile, the following functions are in your environment:

applist  List all installed apps.
appfind  List application full path.
appdir   List application parent directory.

Examples

List all installed application bundles:

$ app list

Find the path of the application bundle, case-insensitive:

$ app find -i 'Docker'

Retrieve the directory containing the application bundle:

$ app dir 'Docker'

Call the former commands as functions in your shell profile:

$ applist
/Applications/Safari.app
/System/Applications/Notes.app
/System/Applications/Preview.app

$ appfind -i 'docker'
/Applications/Docker.app

$ appdir 'Docker'
/Applications

Standards

The app.sh script is compatible with ISO 9945:2009, also known as POSIX.1-2017.1

License

apputils is licensed under the terms of the MIT License.

See the LICENSE file for details.

Footnotes

  1. IEEE Std 1003.1-2017: Standard for Information Technology — Portable Operating System Interface (POSIX®), ISO/IEC/IEEE 9945:2009/COR 2:2017. URL: https://pubs.opengroup.org/onlinepubs/9699919799/