For SmartfaceCloud project added support for custom IDE provider name

Added support for confirmation dialog to display IDE provider name for
other providers, such as Smartface
pull/134/merge
alperozisik 2015-08-27 12:17:04 +03:00
rodzic 3752564d62
commit 0543eea061
6 zmienionych plików z 3135 dodań i 297 usunięć

Wyświetl plik

@ -1,242 +0,0 @@
#!/bin/bash -e
set -e
has() {
type "$1" > /dev/null 2>&1
return $?
}
# Redirect stdout ( > ) into a named pipe ( >() ) running "tee"
exec > >(tee /tmp/installlog.txt)
# Without this, only stdout would be captured - i.e. your
# log file would not contain any error messages.
exec 2>&1
NODE_VERSION=v0.10.28
APPSUPPORT_USER=$HOME/.c9
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RUNTIME=$SCRIPT/..
INSTALL_DIR=/tmp/c9-`date '+%s'`
ORIGINAL_USER=`basename $HOME`
OSX_INSTALLER_PATH=$2
start() {
if [ $# -lt 1 ]; then
start base
return
fi
# Try to figure out the os and arch for binary fetching
local uname="$(uname -a)"
local os=
local arch="$(uname -m)"
case "$uname" in
Linux\ *) os=linux ;;
Darwin\ *) os=darwin ;;
SunOS\ *) os=sunos ;;
FreeBSD\ *) os=freebsd ;;
esac
case "$uname" in
*x86_64*) arch=x64 ;;
*i*86*) arch=x86 ;;
*armv6l*) arch=arm-pi ;;
esac
if [ $os != "linux" ] && [ $os != "darwin" ]; then
echo "Unsupported Platform: $os $arch" 1>&2
exit 1
fi
if [ $arch != "x64" ] && [ $arch != "x86" ]; then
echo "Unsupported Architecture: $os $arch" 1>&2
exit 1
fi
if [ $os == "darwin" ]; then
APPSUPPORT_USER="$HOME/Library/Application Support/Cloud9"
APPTARGET=$OSX_INSTALLER_PATH
APPSUPPORT="/Library/Application Support/Cloud9"
RUNTIME="${APPTARGET}/Contents/Resources/app.nw"
fi
case $1 in
"help" )
echo
echo "Cloud9 Installer"
echo
echo "Usage:"
echo " install help Show this message"
echo " install install [name [name ...]] Download and install a set of packages"
echo " install ls List available packages"
echo
;;
"ls" )
echo "!node - Node.js"
echo "!tmux_install - TMUX"
echo "!nak - NAK"
echo "!vfsextend - VFS extend"
echo "!ptyjs - pty.js"
echo "!c9cli - C9 CLI"
echo "!sc - Sauce Connect"
echo "coffee - Coffee Script"
echo "less - Less"
echo "sass - Sass"
echo "typescript - TypeScript"
echo "stylus - Stylus"
# echo "go - Go"
# echo "heroku - Heroku"
# echo "rhc - RedHat OpenShift"
# echo "gae - Google AppEngine"
;;
"install" )
shift
# make sure dirs are around
mkdir -p "$APPSUPPORT/bin"
mkdir -p "$APPSUPPORT/node_modules"
cd "$APPSUPPORT"
cp -a "$SCRIPT" "$INSTALL_DIR"
# install packages
while [ $# -ne 0 ]
do
time eval ${1} $os $arch
shift
done
# finalize
#pushd $APPSUPPORT/node_modules/.bin
#for FILE in $APPSUPPORT/node_modules/.bin/*; do
# if [ `uname` == Darwin ]; then
# sed -i "" -E s:'#!/usr/bin/env node':"#!$NODE":g $(readlink $FILE)
# else
# sed -i -E s:'#!/usr/bin/env node':"#!$NODE":g $(readlink $FILE)
# fi
#done
#popd
VERSION=`cat $RUNTIME/version || echo 1`
echo 1 > "$APPSUPPORT/installed"
echo $VERSION > "$APPSUPPORT/version"
# set chown/chmod of application dirs for update
echo "Testing existence of APPTARGET (${APPTARGET})"
if [ -d "$APPTARGET" ]; then
echo "Updating permissions of APPTARGET (${APPTARGET})"
chown -R root:admin "$APPTARGET" || chown -R root:staff "$APPTARGET"
chmod -R 775 "$APPTARGET"
fi
echo "Testing existence of APPSUPPORT (${APPSUPPORT})"
if [ -d "$APPSUPPORT" ]; then
echo "Updating permissions of APPSUPPORT (${APPSUPPORT})"
chown -R root:admin "$APPSUPPORT" || chown -R root:staff "$APPSUPPORT"
chmod -R 775 "$APPSUPPORT"
fi
echo "Testing existence of APPSUPPORT_USER (${APPSUPPORT_USER})"
if [ -n "$ORIGINAL_USER" ] && [ -d "$APPSUPPORT_USER" ]; then
echo "Updating permissions of APPSUPPORT_USER (${APPSUPPORT_USER})"
chown -R $ORIGINAL_USER "$APPSUPPORT_USER"
fi
rm -Rf $INSTALL_DIR
echo :Done.
;;
"base" )
echo "Installing base packages. Use '`basename $0` help' for more options"
start install node tmux_install nak ptyjs sc vfsextend c9cli
;;
* )
start base
;;
esac
}
# NodeJS
node(){
# clean up
rm -rf node
rm -rf node-$NODE_VERSION*
echo :Installing Node $NODE_VERSION
cd "$INSTALL_DIR"
tar xvfz node-$NODE_VERSION-$1-$2.tar.gz
rm -Rf "$APPSUPPORT/node"
mv node-$NODE_VERSION-$1-$2 "$APPSUPPORT/node"
}
tmux_install(){
echo :Installing TMUX
mkdir -p "$APPSUPPORT/bin"
if [ $os = "darwin" ]; then
cd "$INSTALL_DIR"
python rudix.py -i libevent-2.0.21-0.pkg
python rudix.py -i tmux-1.9-0.pkg
if ! type "/usr/local/bin/tmux"; then
echo "Installation Failed"
exit 100
fi
ln -sf "/usr/local/bin/tmux" "$APPSUPPORT/bin/tmux"
# Linux
else
echo "Unsupported"
fi
}
vfsextend(){
echo :Installing VFS extend
cd "$INSTALL_DIR"
tar xvfz c9-vfs-extend.tar.gz
rm -Rf "$APPSUPPORT/c9-vfs-extend"
mv c9-vfs-extend "$APPSUPPORT"
}
sc(){
echo :Installing Sauce Connect
cd "$INSTALL_DIR"
tar xvzf sc-4.0-latest.tar.gz
rm -rf "$APPSUPPORT/sc"
mv sc-4.0-latest "$APPSUPPORT/sc"
}
nak(){
echo :Installing Nak
cd "$INSTALL_DIR"
tar -zxvf nak.tar.gz
mkdir -p "$APPSUPPORT/node_modules/.bin"
rm -Rf "$APPSUPPORT/node_modules/nak"
mv nak "$APPSUPPORT/node_modules"
ln -s "$APPSUPPORT/node_modules/nak/bin/nak" "$APPSUPPORT/node_modules/.bin/nak" &2> /dev/null
}
ptyjs(){
echo :Installing pty.js
cd "$INSTALL_DIR"
tar -zxvf pty-$NODE_VERSION-$1-$2.tar.gz
mkdir -p "$APPSUPPORT/node_modules"
rm -Rf "$APPSUPPORT/node_modules/pty.js"
mv pty.js "$APPSUPPORT/node_modules"
}
c9cli(){
if [ -d "/usr/local/bin/" ]; then
chmod +x "$RUNTIME/bin/c9"
ln -s -f "$RUNTIME/bin/c9" /usr/local/bin/c9
else
echo "unable to add c9cli to the path"
fi
}
start $@

Wyświetl plik

@ -1,7 +1,7 @@
{
"name": "c9",
"description": "New Cloud9 Client",
"version": "3.0.1",
"version": "3.0.806",
"author": "Ajax.org B.V. <info@ajax.org>",
"private": true,
"main": "bin/c9",
@ -9,43 +9,54 @@
"type": "git",
"url": "http://github.com/c9/core.git"
},
"dependencies": {
"acorn": ">=0.11.0",
"amd-loader": "~0.0.5",
"async": "~0.2.7",
"base64id": "~0.1.0",
"c9": "0.1.0",
"connect": "~2.12.0",
"debug": "~0.7.4",
"ejs": "~0.8.3",
"engine.io": "~1.3.1",
"engine.io-client": "~1.3.1",
"eslint": "git://github.com/cloud9ide/eslint.git#e2d052aafd81ea0aa6d1d4fd9f88f3613e386160",
"http-error": "~0.0.5",
"less": "~1.5.1",
"mime": "~1.2.9",
"mkdirp": "~0.3.5",
"msgpack-js": "~0.1.1",
"msgpack-js-browser": "~0.1.4",
"nak": "",
"netutil": "~0.0.1",
"optimist": "~0.6.0",
"pty.js": "~0.2.3",
"qs": "0.6.6",
"rusha": "~0.7.2",
"send": "~0.1.4",
"simple-mime": "~0.0.8",
"tern": "git://github.com/lennartcl/tern.git#97464df789dbb4d81ca4579383a02b320c69563d",
"tern_from_ts": "git://github.com/cloud9ide/tern_from_ts.git#b8b3d555e545aa41ed8d0df054ef38416a578faa",
"through": "2.2.0",
"tmp": "~0.0.20",
"uglify-js": "2.4.16",
"ui": "",
"ws": "0.4.31"
},
"optionalDependencies": {
"heapdump": "0.2.10"
},
"sdkDependencies": [
"ace",
"ace_tree",
"acorn",
"amd-loader",
"architect",
"architect-build",
"async",
"base64id",
"c9",
"connect",
"connect-architect",
"debug",
"ejs",
"engine.io",
"engine.io-client",
"eslint",
"frontdoor",
"http-error",
"kaefer",
"less",
"mime",
"mkdirp",
"msgpack-js",
"msgpack-js-browser",
"nak",
"netutil",
"optimist",
"pty.js",
"qs",
"rusha",
"send",
"simple-mime",
"smith",
"tern",
"tern_from_ts",
"through",
"tmp",
"treehugger",
"uglify-js",
"ui",
"vfs-child",
"vfs-http-adapter",
"vfs-local",
"vfs-socket",
"ws"
],
"dependencies": {},
"licenses": [],
"c9plugins": {
"c9.ide.language": "#9f588f9152",
@ -64,7 +75,8 @@
"c9.ide.find": "#be3bca94b7",
"c9.ide.find.infiles": "#462928475c",
"c9.ide.find.replace": "#fe41fa768d",
"c9.ide.run.debug": "#b734a2a47f",
"c9.ide.run.debug": "#3e9ce59b1b",
"c9.automate": "#47e2c429c9",
"c9.ide.ace.emmet": "#e5f1a92ac3",
"c9.ide.ace.gotoline": "#4d1a93172c",
"c9.ide.ace.keymaps": "#422e83553b",
@ -73,7 +85,7 @@
"c9.ide.ace.statusbar": "#d7b45bb7c3",
"c9.ide.ace.stripws": "#34426a03d1",
"c9.ide.behaviors": "#f5aaf10aff",
"c9.ide.closeconfirmation": "#a28bfd8272",
"c9.ide.closeconfirmation": "#cee4674141",
"c9.ide.configuration": "#8627b7d37d",
"c9.ide.dialog.wizard": "#a588b64050",
"c9.ide.fontawesome": "#781602c5d8",
@ -93,9 +105,12 @@
"c9.ide.readonly": "#f6f07bbe42",
"c9.ide.recentfiles": "#7c099abf40",
"c9.ide.remote": "#37773d905b",
"c9.ide.processlist": "#bc11818bb5",
"c9.ide.run": "#9bf773dd1b",
"c9.ide.run.build": "#2ba0107f97",
"c9.ide.run.debug.xdebug": "#61dcbd0180",
"c9.ide.save": "#4cf2ae332c",
"c9.ide.scm": "#undefined",
"c9.ide.terminal.monitor": "#8e025b3ae1",
"c9.ide.theme.flat": "#5c7c27ab74",
"c9.ide.threewaymerge": "#229382aa0b",

Wyświetl plik

@ -1,15 +0,0 @@
"use strict";
var assert = require("assert");
plugin.consumes = [];
plugin.provides = ["assert.root"];
module.exports = plugin;
function plugin(options, imports, register) {
assert.equal(process.getuid(), 0, "You need to be root to run this config");
register(null, {
"assert.root": {}
});
}

Wyświetl plik

@ -0,0 +1,89 @@
define(function(require, exports, module) {
"use strict";
main.consumes = [
"Plugin", "c9", "ui", "menus", "tree", "info", "vfs"
];
main.provides = ["download"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
var ui = imports.ui;
var c9 = imports.c9;
var menus = imports.menus;
var tree = imports.tree;
var vfs = imports.vfs;
var info = imports.info;
/***** Initialization *****/
var plugin = new Plugin("Ajax.org", main.consumes);
var loaded = false;
function load(){
if (loaded) return false;
loaded = true;
menus.addItemByPath("File/Download Project", new ui.item({
onclick: downloadProject
}), 1300, plugin);
// Context Menu
tree.getElement("mnuCtxTree", function(mnuCtxTree) {
menus.addItemToMenu(mnuCtxTree, new ui.item({
match: "folder|project",
isAvailable: function(){
return tree.selectedNode;
},
caption: "Download",
onclick: download
}), 140, plugin);
});
}
function download() {
if (!c9.has(c9.STORAGE))
return;
var node = tree.selectedNode;
if (!node) return;
if (node.isFolder && node.path == "/")
downloadProject();
else if (node.isFolder)
downloadFolder(node.path);
else
downloadFile(node.path);
}
function downloadProject() {
vfs.download("/", info.getWorkspace().name + ".tar.gz");
}
function downloadFolder(path) {
vfs.download(path.replace(/\/*$/, "/"));
}
function downloadFile(path) {
vfs.download(path.replace(/\/*$/, ""), null, true);
}
/***** Lifecycle *****/
plugin.on("load", function(){
load();
});
/***** Register and define API *****/
plugin.freezePublicAPI({
});
register(null, {
download: plugin
});
}
});

Wyświetl plik

@ -0,0 +1,20 @@
var modules = require("module");
var oldResolve = modules._resolveFilename;
var extraPaths = [
__dirname + "/../node_modules/ace/lib",
__dirname + "/../node_modules/treehugger/lib",
__dirname + "/../node_modules/v8debug/lib",
__dirname + "/../"
];
modules._resolveFilename = function(request, paths) {
// Ensure client extensions can be loaded
request = request.replace(/^ext\//, "ext.")
.replace(/^core\//, "cloud9.core/www/core/")
.replace(/^lib\/chai\//, "chai/");
// Add the extra paths
extraPaths.forEach(function(p) {
if(paths.paths.indexOf(p) === -1)
paths.paths.push(p);
});
return oldResolve(request, paths);
};