cleanup (code): remove dead code

This commit is contained in:
Mickael KERJEAN
2019-01-28 01:09:45 +11:00
parent c3d34e6f87
commit e6c2923e20
8 changed files with 0 additions and 194 deletions
-19
View File
@@ -1,19 +0,0 @@
const fs = require("fs"),
path = require("path");
const lines = fs.readFileSync(path.join(__dirname, "../../config_client.js"))
.toString()
.split("\n");
let isGitBlock = false;
for(let i=0, l=lines.length; i<l; i++){
let tmp;
if(lines[i].trim() === "git: {") isGitBlock = true;
else if(lines[i].trim() === "},") tmp = false;
if(isGitBlock === true) lines[i] = "//"+lines[i];
if(tmp === false) isGitBlock = false;
}
fs.writeFileSync(path.join(__dirname, "../../config_client.js"), lines.join("\n"));
-1
View File
@@ -1 +0,0 @@
module.exports = {};
-52
View File
@@ -1,52 +0,0 @@
#!/bin/bash
set -e
TERMUX_PATH=/data/data/com.termux/files
cd $TERMUX_PATH/usr/share
echo "======================="
echo "Nuage for Termux =="
echo "======================="
echo "> Install system dependencies"
apt install -y nodejs git g++ make
echo "> Install Nuage"
if [ ! -d "nuage" ]; then
git clone https://github.com/mickael-kerjean/nuage
cd nuage
else
cd nuage
git reset --hard
git pull origin master
fi
echo "> Configure Nuage for termux"
# get rid of nodegit until it's working (https://github.com/nodegit/nodegit/issues/1494)
cp .assets/scripts/git.js server/model/backend/git.js
sed -i '/nodegit/d' package.json
node .assets/scripts/configure_without_git.js
# setup node gyp for android build (node-sass compilation)
npm install node-gyp
node node_modules/node-gyp/bin/node-gyp.js configure > /dev/null 2>&1 || true # generate the "~/.node-gyp"
find ~/.node-gyp -name 'common.gypi' -exec sed -i "s/\-fPIE.*/\-fPIC' ],/g" {} \;
echo "> Installation"
npm install
npm run build
cat >> $TERMUX_PATH/usr/bin/nuage <<EOF
#!/bin/bash
node $TERMUX_PATH/usr/share/nuage/server/index.js &
EOF
chmod +x $TERMUX_PATH/usr/bin/nuage
echo "> Post install "
rm -rf ~/.node-gyp
echo "============================"
echo "COMPLETED"
-5
View File
@@ -1,5 +0,0 @@
describe('Helpers::event', () => {
it('test', () => {
});
});
-20
View File
@@ -1,20 +0,0 @@
// import assert from 'assert';
// import { encrypt, decrypt } from '../client/helpers/';
// describe("Helper::crypto", function() {
// it("can encrypt", function() {
// const key = "SUPER_KEY";
// const obj = {a: 3, b:4}
// const encrypted_obj = encrypt(obj, key);
// assert.ok(encrypted_obj);
// assert.notEqual(obj, encrypted_obj);
// });
// it("can decrypt", function() {
// const key = "SUPER_KEY";
// const obj = {a: 3, b:4}
// const encrypted_obj = encrypt(obj,key);
// const decrypted_obj = decrypt(encrypted_obj, key);
// assert.equal(JSON.stringify(obj), JSON.stringify(decrypted_obj));
// });
// });
-44
View File
@@ -1,44 +0,0 @@
// import assert from 'assert';
// import { event } from '../client/helpers/';
// describe("Helper::event", function() {
// afterEach(function(){
// event.fns = [];
// });
// it("can register", function() {
// assert.equal(0, event.fns.length);
// event.subscribe("event::test", function(){});
// assert.equal(1, event.fns.length);
// });
// it("can unregister", function() {
// assert.equal(0, event.fns.length);
// event.subscribe("event::test", function(){});
// assert.equal(1, event.fns.length);
// event.unsubscribe("event::test");
// assert.equal(0, event.fns.length);
// });
// it("can emit", function(done){
// event.subscribe('event::test', function(){
// done();
// });
// event.emit("event::test")
// });
// it("can emit multiple times", function(done){
// let count = 0;
// event.subscribe('event::test', function(){
// count += 1;
// if(count === 3){
// done();
// }else{
// assert.equal(true, count < 3);
// }
// });
// event.emit("event::test");
// event.emit("event::test");
// event.emit("event::test");
// });
// });
-24
View File
@@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Mocha Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css">
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script>mocha.setup('bdd')</script>
<!-- Helpers -->
<!--<script type="module" src="/client/helpers/events.js"></script>-->
<script type="module" src="../client/helpers/crypto.js"></script>
<!-- load your test files here -->
<script>
mocha.run();
</script>
</body>
</html>
-29
View File
@@ -1,29 +0,0 @@
var tests = [];
for (var file in window.__karma__.files) {
if (window.__karma__.files.hasOwnProperty(file)) {
if (/Spec\.js$/.test(file)) {
tests.push(file);
}
}
}
requirejs.config({
baseUrl: '/base/src',
paths: {
'jquery': '../lib/jquery',
'underscore': '../lib/underscore',
},
shim: {
'underscore': {
exports: '_'
}
},
// ask Require.js to load these files (all our tests)
deps: tests,
// start test run, once Require.js is done
callback: window.__karma__.start
});