kaffee
Version:
Kaffee is a software project management tool similar to Maven and is written in Coffeescript. Kaffee allows you to compile, test, minify and many other tasks to make building your application simple and fun again.
72 lines (47 loc) • 1.28 kB
JavaScript
(function() {
var Fs, Path, Workspace;
Fs = require("fs");
Path = require("path");
/*
The {@link Workspace} class is a pointer to the workspace of a {@link Project}
@author Fabian M. <mail.fabianm@gmail.com>
*/
Workspace = (function() {
/*
Constructs a new {@link Workspace} instance.
@since 0.1.1
@param path The path pointing to the workspace.
*/
function Workspace(path) {
if (path == null) {
path = ".";
}
this.path = Path.resolve(path);
}
/*
Returns the path pointing to the workspace.
@since 0.1.1
@return The path pointing to the workspace.
*/
Workspace.prototype.getPath = function() {
return this.path;
};
/*
Determines if this workspace exists or not.
@since 0.1.1
@return <code>true</code> if this workspace exists, <code>false</code> otherwise.
*/
Workspace.prototype.exists = function() {
return Fs.existsSync(this.path);
};
/*
Creates this workspace.
@since 0.1.1
*/
Workspace.prototype.create = function() {
return Fs.mkdirSync(this.path);
};
return Workspace;
})();
module.exports = Workspace;
}).call(this);