]>
Commit | Line | Data |
---|---|---|
bc78a6d5 RC |
1 | /* |
2 | * Copyright (c) 2001, Jan Nieuwenhuizen. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Jan Nieuwenhuizen <janneke@gnu.org> | |
13 | * | |
14 | */ | |
15 | #ifndef SCRIPT_H | |
16 | #define SCRIPT_H | |
17 | ||
3c054baf RC |
18 | #include "String++.h" |
19 | ||
bc78a6d5 RC |
20 | /* Run the script fname, found in dir. If fname has suffix .sh, and |
21 | we have a Bourne shell, execute it using sh. Otherwise, if fname | |
22 | has suffix .bat, execute using cmd */ | |
23 | ||
3c054baf | 24 | void run_script (String const &dir, String const &fname); |
bc78a6d5 RC |
25 | |
26 | /* Initialisation stuff for run_script: sh, cmd, CYGWINROOT and PATH */ | |
27 | void init_run_script (); | |
28 | ||
29 | /* Run the scripts fname.sh and fname.bat, found in dir. */ | |
3c054baf | 30 | void try_run_script (String const &dir, String const &fname); |
bc78a6d5 | 31 | |
ad646f43 RC |
32 | class Script { |
33 | public: | |
34 | static bool isAScript (String const &file); | |
35 | Script (String const &fileName); | |
36 | String baseName()const; | |
37 | private: | |
38 | String scriptName; | |
39 | }; | |
40 | ||
bc78a6d5 | 41 | #endif /* SCRIPT_H */ |