Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changes to ide.js for infra

  • Loading branch information...
commit 998a8e19a252a01c1aeffa280b4a6386c3ede20a 1 parent e169cb5
@gjtorikian gjtorikian authored
Showing with 17 additions and 6 deletions.
  1. +17 −6 plugins-server/cloud9.core/ide.js
View
23 plugins-server/cloud9.core/ide.js
@@ -30,6 +30,14 @@ var Ide = module.exports = function(options) {
this.workspaceDir = options.workspaceDir;
+ // TODO: find a better way to propogate infra flag to here
+ var packageFlag = false;
+ for (var p = 2; p < process.argv.length; p++) {
+ if (process.argv[p] == "-P") {
+ packageFlag = true;
+ break;
+ }
+ }
options.plugins = options.plugins || [];
this.options = {
@@ -48,7 +56,7 @@ var Ide = module.exports = function(options) {
projectName: options.projectName || this.workspaceDir.split("/").pop(),
version: options.version,
extra: options.extra,
- packed: (options.packed === true) ? true : false,
+ packed: (options.packed === true || packageFlag === true) ? true : false,
packedName: options.packedName,
hosted: !!options.hosted
};
@@ -57,7 +65,7 @@ var Ide = module.exports = function(options) {
this.nodeCmd = options.exec || process.execPath;
this.workspace = new Workspace(this);
-
+ console.log(options);
var _self = this;
this.router = connect.router(function(app) {
app.get(/^(\/|\/index.html?)$/, function(req, res, next) {
@@ -98,8 +106,10 @@ util.inherits(Ide, EventEmitter);
"cache-control": "no-transform",
"Content-Type": "text/html"
});
-
+
var permissions = _self.getPermissions(req);
+ var role = _self.getRole(req);
+ console.log(role); process.exit(10);
var plugins = c9util.arrayToMap(_self.options.plugins);
var bundledPlugins = c9util.arrayToMap(_self.options.bundledPlugins);
@@ -133,12 +143,12 @@ util.inherits(Ide, EventEmitter);
readonly: (permissions.fs !== "rw"),
requirejsConfig: _self.options.requirejsConfig,
settingsXml: "",
- scripts: (_self.options.debug || _self.options.real) ? "" : aceScripts,
+ scripts: (_self.options.debug || _self.options.packed) ? "" : aceScripts,
projectName: _self.options.projectName,
version: _self.options.version,
hosted: _self.options.hosted.toString(),
packed: _self.options.packed,
- packedName: _self.options.packedName
+ packedName: "packed_devel-git.js"
};
var settingsPlugin = _self.workspace.getExt("settings");
@@ -212,12 +222,13 @@ util.inherits(Ide, EventEmitter);
this.getPermissions = function(req) {
var user = this.getUser(req);
+
if (!user)
return User.VISITOR_PERMISSIONS;
else
return user.getPermissions();
};
-
+
this.hasUser = function(username) {
return !!this.$users[username];
};
Please sign in to comment.
Something went wrong with that request. Please try again.