Merge pull request #664 from wolsen/619-fix-graphics-launcher-osx
Use the open -a prefix to commands on OSX
This commit is contained in:
commit
a1a777266b
@ -8,6 +8,8 @@ import java.text.MessageFormat;
|
||||
|
||||
import net.sf.openrocket.appearance.AppearanceBuilder;
|
||||
import net.sf.openrocket.appearance.DecalImage;
|
||||
import net.sf.openrocket.arch.SystemInfo;
|
||||
import net.sf.openrocket.arch.SystemInfo.Platform;
|
||||
import net.sf.openrocket.document.OpenRocketDocument;
|
||||
import net.sf.openrocket.gui.dialogs.EditDecalDialog;
|
||||
import net.sf.openrocket.gui.watcher.FileWatcher;
|
||||
@ -179,6 +181,15 @@ public class EditDecalHelper {
|
||||
command = commandTemplate + " " + filename;
|
||||
}
|
||||
|
||||
/* On OSX, the program needs to be opened using the command
|
||||
* open -a to tell it which application to use to open the
|
||||
* program. Check to see if the command starts with it or not
|
||||
* and pre-pend it as necessary. See issue #619.
|
||||
*/
|
||||
if (SystemInfo.getPlatform() == Platform.MAC_OS && !command.startsWith("open -a")) {
|
||||
command = "open -a " + command;
|
||||
}
|
||||
|
||||
try {
|
||||
Runtime.getRuntime().exec(command);
|
||||
} catch (IOException ioex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user