How to use the mage-engine.builder function in mage-engine

To help you get started, we’ve selected a few mage-engine 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 MageStudio / Mage-Studio / _OLD / app_OLD / App.Storage.js View on Github external
if (!app.storage.workspace) {
            app.dialog.error("Missing Workspace", "Please set your workspace under settings panel");
            return false;
        }
        if (app.storage.currentProject == "BaseProject") {
            app.dialog.error("Missing Project", "Please, create a new Project using File>New option");
            return false;
        }
        var fs = require('fs'),
            mage = require('mage-engine');
        if (!fs.existsSync(dir)){
            fs.mkdirSync(dir);
        }

        mage.builder.create(dir, function(success) {
            if (success) {
                app.dialog.success("Done", "Your project is good to go");
            } else {
                app.dialog.error("Error!", "Error while creating project");
            }
        });
        return true;
    },