mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 14:37:04 +00:00
Support for postinstall scripts
This commit is contained in:
@@ -189,6 +189,8 @@ function gen(/*va_args*/)
|
||||
{
|
||||
fail("The directory " + FILE.absolute(destinationProject) + " already exists.");
|
||||
}
|
||||
|
||||
executePostInstallScript(destinationProject);
|
||||
}
|
||||
|
||||
function createFrameworksInFile(/*Array*/ frameworks, /*String*/ aFile, /*Boolean*/ symlink, /*Boolean*/ build, /*Boolean*/ force)
|
||||
@@ -365,6 +367,19 @@ function listFrameworks()
|
||||
});
|
||||
}
|
||||
|
||||
function executePostInstallScript(/*String*/ destinationProject)
|
||||
{
|
||||
var path = FILE.join(destinationProject, "postinstall");
|
||||
|
||||
if (FILE.exists(path))
|
||||
{
|
||||
stream.print(colorize("Executing postinstall script...", "cyan"));
|
||||
|
||||
OS.system(["/bin/sh", path, destinationProject]); // Use sh in case it isn't marked executable
|
||||
FILE.remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
function colorize(message, color)
|
||||
{
|
||||
return "\0" + color + "(" + message + "\0)";
|
||||
|
||||
Reference in New Issue
Block a user