Use the open -a prefix to commands on OSX
On the OSX platform, the command editor needs to open the program with using the 'open' command. Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
This commit is contained in:
parent
3f0a5b1780
commit
e0982935e1
@ -8,6 +8,8 @@ import java.text.MessageFormat;
|
|||||||
|
|
||||||
import net.sf.openrocket.appearance.AppearanceBuilder;
|
import net.sf.openrocket.appearance.AppearanceBuilder;
|
||||||
import net.sf.openrocket.appearance.DecalImage;
|
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.document.OpenRocketDocument;
|
||||||
import net.sf.openrocket.gui.dialogs.EditDecalDialog;
|
import net.sf.openrocket.gui.dialogs.EditDecalDialog;
|
||||||
import net.sf.openrocket.gui.watcher.FileWatcher;
|
import net.sf.openrocket.gui.watcher.FileWatcher;
|
||||||
@ -179,6 +181,15 @@ public class EditDecalHelper {
|
|||||||
command = commandTemplate + " " + filename;
|
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 {
|
try {
|
||||||
Runtime.getRuntime().exec(command);
|
Runtime.getRuntime().exec(command);
|
||||||
} catch (IOException ioex) {
|
} catch (IOException ioex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user