Skip to content

Instantly share code, notes, and snippets.

View iksheth's full-sized avatar
🎯
Focusing

Karan Sheth iksheth

🎯
Focusing
View GitHub Profile
@iksheth
iksheth / is_installed.sh
Created January 30, 2019 21:17 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.