Run command based on OS

45 views
Skip to first unread message

Andrej Mitrovic

unread,
Nov 13, 2012, 1:20:11 AM11/13/12
to scite-i...@googlegroups.com
I would like to have a SciTEDirectory.properties file, but run one or another command based on which operating system Scite is running on. For example:

# pseudocode
command.go.*.d=$(WIN) ? $(ENV_VAR)\build\build.bat : $(ENV_VAR)/build/build.sh

Are there any tricks I could use to achieve something like this?

Martin Panter

unread,
Nov 13, 2012, 1:26:17 AM11/13/12
to scite-i...@googlegroups.com
Does the PLAT_GTK / PLAT_WIN stuff work in this case? I never used the
directory files or command.go but maybe try something like

if PLAT_WIN
command.go.*.d=. . ./build.bat
if PLAT_GTK # or maybe PLAT_UNIX
command.go.*.d=. . ./build.sh

I think the indentation is required.

steve donovan

unread,
Nov 13, 2012, 1:34:30 AM11/13/12
to scite-i...@googlegroups.com
On Tue, Nov 13, 2012 at 8:26 AM, Martin Panter <vadmi...@gmail.com> wrote:
> if PLAT_WIN
> command.go.*.d=. . ./build.bat
> if PLAT_GTK # or maybe PLAT_UNIX
> command.go.*.d=. . ./build.sh

That's exactly how different compilers are selected by platform - look
at the end of cpp.properties

steve d.

Andrej Mitrovic

unread,
Nov 13, 2012, 12:52:41 PM11/13/12
to scite-interest
On Nov 13, 7:26 am, Martin Panter <vadmium...@gmail.com> wrote:
> if PLAT_WIN
>         command.go.*.d=. . ./build.bat
> if PLAT_GTK  # or maybe PLAT_UNIX
>         command.go.*.d=. . ./build.sh
>
> I think the indentation is required.

Awesome, thanks!

It's documented under the "Importing properties files and conditional
logic" section but I wasn't able to find it.
Reply all
Reply to author
Forward
0 new messages