打印信息 /usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /Applications/Safari.app/Contents/Info.plist
if [ "$(uname)" == "Darwin" ]; then
cp -R ~/Downloads/atom-shell-v0.17.2-darwin-x64/Atom.app $TARGET
mv .tmp $TARGET/Atom.app/Contents/Resources/app
PLIST="`pwd`/$TARGET/Atom.app/Contents/Info.plist" # must provide absolute path (i.e start with slash?) to modify a file directly
defaults write $PLIST CFBundleName "$APP_NAME"
defaults write $PLIST CFBundleDisplayName "$APP_NAME"
defaults write $PLIST CFBundleIdentifier "com.example.my-app"
defaults write $PLIST CFBundleIconFile "app/app.icns"
mv $TARGET/Atom.app "$TARGET/$APP_NAME.app"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo "Not implemented!"
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
mkdir $TARGET/atom-shell
cp -R ~/Downloads/atom-shell-v0.17.2-win32-ia32/* $TARGET/atom-shell
mv .tmp $TARGET/atom-shell/resources/app
RCEDIT="`echo ~/Downloads/rcedit.exe`" # from https://github.com/atom/rcedit/releases/download/v0.1.0/rcedit.exe
EXEFILE="$TARGET/atom-shell/atom.exe"
$RCEDIT $EXEFILE --set-icon app.ico
$RCEDIT $EXEFILE --set-version-string CompanyName "Example LLC"
$RCEDIT $EXEFILE --set-version-string FileDescription "$APP_NAME"
$RCEDIT $EXEFILE --set-version-string ProductName "$APP_NAME"
#mv $TARGET/atom-shell/atom.exe $TARGET/atom-shell/myapp.exe
mv $TARGET/atom-shell "$TARGET/$APP_NAME"
fi