removed source command, added elif on os check, added -p command to mkdir to fail silently if directory exists