How to use the jake.fileCreate function in jake

To help you get started, we’ve selected a few jake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cappuccino / cappuccino / Objective-J / CommonJS / lib / objective-j / jake / applicationtask.js View on Github external
ApplicationTask.prototype.defineFrameworksTask = function()
{
    // FIXME: platform requires...
    if (!this._frameworksPath && this.environments().indexOf(require("objective-j/jake/environment").Browser) === -1)
        return;

    var buildPath = this.buildProductPath(),
        newFrameworks = FILE.join(buildPath, "Frameworks"),
        thisTask = this;

    Jake.fileCreate(newFrameworks, function()
    {
        if (thisTask._frameworksPath === "capp")
            OS.system(["capp", "gen", "-f", "--force", buildPath]);
        else if (thisTask._frameworksPath)
        {
            if (FILE.exists(newFrameworks))
                FILE.rmtree(newFrameworks);

            // If there is a Frameworks/Source directory, move it temporarily
            // so it doesn't get copied.
            var sourcePath = FILE.join(thisTask._frameworksPath, "Source"),
                hasSource = FILE.exists(sourcePath),
                tempPath = FILE.join(FILE.cwd(), ".__capp_Frameworks_Source__");

            if (hasSource)
                FILE.move(sourcePath, tempPath);