* Written by Jan Nieuwenhuizen <janneke@gnu.org>
*
*/
-#ifndef SCRIPT_H
-#define SCRIPT_H
+#ifndef SETUP_SCRIPT_H
+#define SETUP_SCRIPT_H
-/* Run the script fname, found in dir. If fname has suffix .sh, and
- we have a Bourne shell, execute it using sh. Otherwise, if fname
- has suffix .bat, execute using cmd */
+#include "String++.h"
-void run_script (char const *dir, char const *fname);
-
/* Initialisation stuff for run_script: sh, cmd, CYGWINROOT and PATH */
void init_run_script ();
/* Run the scripts fname.sh and fname.bat, found in dir. */
-void try_run_script (char const *dir, char const *fname);
+void try_run_script (String const &dir, String const &fname);
+
+class Script {
+public:
+ static bool isAScript (String const &file);
+ Script (String const &fileName);
+ String baseName() const;
+ String fullName() const;
+/* Run the script. If it it's suffix is .sh, and
+ we have a Bourne shell, execute it using sh. Otherwise, if the
+ suffix is .bat, execute using cmd */
+ void run() const;
+private:
+ String scriptName;
+ static char const ETCPostinstall[];
+ char const * extension() const;
+};
-#endif /* SCRIPT_H */
+#endif /* SETUP_SCRIPT_H */