Esempio n. 1
0
function compileStylus (cssPath) {
    var stylFile = "";
    if (fs.existsSync(cssPath + "style.styl")) {
        stylFile = cssPath + "style.styl";
    } else {
        //No STYL style file
        return;
    }
    if (livereload) {
        terminal.write("\n");
    }
    terminal.write("    Compiling Stylus ... ");
    var styleFile = fs.readFileSync(stylFile);
    try {
        styleFile = stylus(styleFile.toString()).set('paths', [cssPath]).set('compress', true).use(nib()).render();
        terminal.color("green").write("OK!").reset().write("\n");

        terminal.write("    Saving Compiled Stylus... ");
        fs.writeFileSync(cssPath + "style.css", styleFile);
        terminal.color("green").write("OK!").reset().write("\n\n");
        if (livereload) {
            http.get("http://localhost:35729/changed?files=" + cssPath + "style.css");
        }

    } catch (e) {
        terminal.color("red").write("Error!").reset().write("\n\n");
    }
}
Esempio n. 2
0
app.command('create <app_name>').description("Create a new Jett app").action(function(app_name) {
    terminal.colorize("\n%W%0%UCreating " + app_name + "%n\n");
    terminal.write("    Downloading Repo ... ");
    download({user: '******', repo: 'Jett'}, process.cwd() + "/." + app_name)
        .on('error', function(err){
            terminal.color("red").write(err).reset().write("\n\n");
            process.kill();
        })
        .on('end', function(){
            fs.renameSync(process.cwd() + "/." + app_name,  process.cwd() + "/" + app_name);
            deleteFolder(process.cwd() + "/." + app_name);
            terminal.color("green").write("OK!").reset().write("\n\n");
        });
});