]> cygwin.com Git - cygwin-apps/setup.git/blob - script.h
* Makefile.am: Treat libgetopt++ as full-fledged SUBDIRS.
[cygwin-apps/setup.git] / script.h
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 SETUP_SCRIPT_H
16 #define SETUP_SCRIPT_H
17
18 /* Initialisation stuff for run_script: sh, cmd, CYGWINROOT and PATH */
19 void init_run_script ();
20
21 /* Run the script named dir/fname.ext
22 Returns the script exit status or negative error if any. */
23 int try_run_script (const std::string& dir,
24 const std::string& fname,
25 const std::string& ext);
26
27 class Script {
28 public:
29 static bool isAScript (const std::string& file);
30 Script (const std::string& fileName);
31 std::string baseName() const;
32 std::string fullName() const;
33 /* Run the script. If its suffix is .sh, and we have a Bourne shell, execute
34 it using sh. Otherwise, if the suffix is .bat, execute using cmd.exe (NT)
35 or command.com (9x). Returns the exit status of the process, or
36 negative error if any. */
37 int run() const;
38 private:
39 std::string scriptName;
40 static char const ETCPostinstall[];
41 char const * extension() const;
42 };
43
44 #endif /* SETUP_SCRIPT_H */
This page took 0.03484 seconds and 5 git commands to generate.