diff --git a/README.md b/README.md index 9556512..74859bf 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,16 @@ module.exports.secret = ... // A secret string used to hash stuff ## Compiling the static js files There are two ways to compile the static js files : - - either you don't mind not minifying the code, and you can use `compiler.sh` to compile - - or you absolutely want to minify the code, and you'll need - [closure-compiler](https://github.com/google/closure-compiler) + - either you don't mind not minifying the code, and you can use `compiler.sh` + to compile + - or you absolutely want to minify the code -### Compiling without minifying -To compile without minifying, simply run -``` -make -``` -in `static/js`. +First, `cd` to `utils/`. Here you'll find a script `build_all.sh` that, as its +name suggests, builds all. By default, it minifies the code, but you can pass +the option `--dev` to avoid minifying (which is a quite long operation). -### Compiling and minifying -To compile and minify the js files, you have to run -``` -make TYPE=RELEASE -``` - -If it doesn't work, check in the `Makefile` that the path to `closure-compiler.jar` -is correct. - -### Check if it worked -If it worked, you should see lots of files in `*.min.js` in your `static/js` directory. +If it worked, you should see lots of files in `*.min.js` in your `static/js` +directory, and a `geo.min.js` in your `lib` (at the root of the repository). ## Running the server As usual with NodeJS, it's quite easy to test. Just ensure you have `node` @@ -54,6 +42,17 @@ npm install node server.js ``` -You should be able to go to [localhost:4000](http://localhost:4000) and see the result. +You should be able to go to [localhost:4000](http://localhost:4000) and see the +result. -Please note that some static files (some meshes / textures) are not on this repository (especially the heavy ones). +Please note that some static files (some meshes / textures) are not on this +repository (especially the heavy ones). + +## Developping +If you want to dev on this project, the `utils/demon.sh` may help you : it is +based on [nodemon](https://github.com/remy/nodemon) (that basically restarts +the server everytime there is a change in the code) and +[inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) (that basically +recompiles everything when there is a modification). To use it, just `cd` to +`utils` and run `demon.sh` (note that it doesn't minify the code since this +operation is heavy and too long to redo everytime there is a change). diff --git a/controllers/prototype/index.js b/controllers/prototype/index.js index 1047287..2d5f4e4 100644 --- a/controllers/prototype/index.js +++ b/controllers/prototype/index.js @@ -1,4 +1,4 @@ -var tools = require('../../my_modules/filterInt'); +var tools = require('../../lib/filterInt'); var pg = require('pg'); var pgc = require('../../private'); var db = require('./dbrequests'); diff --git a/controllers/stream/index.js b/controllers/stream/index.js index d9b26af..17bdafd 100644 --- a/controllers/stream/index.js +++ b/controllers/stream/index.js @@ -1,4 +1,4 @@ -var tools = require('../../my_modules/filterInt') +var tools = require('../../lib/filterInt') module.exports.index = function(req, res, next) { diff --git a/geo/Makefile b/geo/Makefile index 40a9a2f..58a2a31 100644 --- a/geo/Makefile +++ b/geo/Makefile @@ -1,9 +1,9 @@ OPT=--compilation_level SIMPLE_OPTIMIZATIONS ifeq ($(TYPE),RELEASE) - CLOSURE=java -jar /usr/share/java/closure-compiler/closure-compiler.jar + CLOSURE=java -jar ../utils/closure-compiler/closure-compiler.jar else - CLOSURE=../utils/compiler.sh + CLOSURE=../utils/simple-compiler/compiler.sh endif all: Geo diff --git a/js/Makefile b/js/Makefile index dcad816..50e1ee0 100644 --- a/js/Makefile +++ b/js/Makefile @@ -1,9 +1,9 @@ OPT=--compilation_level SIMPLE_OPTIMIZATIONS ifeq ($(TYPE),RELEASE) - CLOSURE=java -jar /usr/share/java/closure-compiler/closure-compiler.jar + CLOSURE=java -jar ../utils/closure-compiler/closure-compiler.jar else - CLOSURE=../utils/compiler.sh + CLOSURE=../utils/simple-compiler/compiler.sh endif all: List ListTest Socket Three Stats ThreeTools Bouncing Multisphere StreamingSimulator PrototypeTools PrototypeReplay PrototypeInteractive Tutorial diff --git a/my_modules/filterInt.js b/lib/filterInt.js similarity index 100% rename from my_modules/filterInt.js rename to lib/filterInt.js diff --git a/utils/build_all.sh b/utils/build_all.sh new file mode 100755 index 0000000..4059eb2 --- /dev/null +++ b/utils/build_all.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +type="RELEASE" + +if [ "$1" == "--dev" ] || [ "$1" == "-d" ]; then + echo yes + type="DEV" +elif [ "$1" == "--help" ] || [ "$1" == "-h" ]; then + echo -e "This is the 3dinterface builder" + echo -e "\t - ./build_all.sh \t\tBuilds and minify everything needed" + echo -e "\t - ./build_all.sh --dev\t\tBuilds everything without minifying" + exit 0 +fi + +cd ../js +make -j TYPE=$type +cd ../geo +make -j TYPE=$type + diff --git a/utils/closure-compiler/COPYING b/utils/closure-compiler/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/utils/closure-compiler/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/utils/closure-compiler/README.md b/utils/closure-compiler/README.md new file mode 100644 index 0000000..2d88c4d --- /dev/null +++ b/utils/closure-compiler/README.md @@ -0,0 +1,530 @@ +# [Google Closure Compiler](https://developers.google.com/closure/compiler/) + +[![Build Status](https://travis-ci.org/google/closure-compiler.svg?branch=master)](https://travis-ci.org/google/closure-compiler) + +The [Closure Compiler](https://developers.google.com/closure/compiler/) is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. + +## Getting Started + * [Download the latest version](http://dl.google.com/closure-compiler/compiler-latest.zip) + * See the [Google Developers Site](https://developers.google.com/closure/compiler/docs/gettingstarted_app) for documentation including instructions for running the compiler from the command line. + +## Options for Getting Help +1. Post in the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss) +2. Ask a question on [Stack Overflow](http://stackoverflow.com/questions/tagged/google-closure-compiler) +3. Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ) + +## Building it Yourself + +Note: The Closure Compiler requires [Java 7 or higher](http://www.java.com/). + +### Using [Ant](http://ant.apache.org/) + +1. Download the [Ant build tool](http://ant.apache.org/bindownload.cgi). + +2. At the root of the source tree, there is an Ant file named ```build.xml```. + To use it, navigate to the same directory and type the command + + ``` + ant jar + ``` + + This will produce a jar file called ```build/compiler.jar```. + +### Using [Eclipse](http://www.eclipse.org/) + +1. Download and open the [Eclipse IDE](http://www.eclipse.org/). +2. Navigate to ```File > New > Project ...``` and create a Java Project. Give + the project a name. +3. Select ```Create project from existing source``` and choose the root of the + checked-out source tree as the existing directory. +3. Navigate to the ```build.xml``` file. You will see all the build rules in + the Outline pane. Run the ```jar``` rule to build the compiler in + ```build/compiler.jar```. + +## Running + +On the command line, at the root of this project, type + +``` +java -jar build/compiler.jar +``` + +This starts the compiler in interactive mode. Type + +```javascript +var x = 17 + 25; +``` + +then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux) +and "Enter" again. The Compiler will respond: + +```javascript +var x=42; +``` + +The Closure Compiler has many options for reading input from a file, writing +output to a file, checking your code, and running optimizations. To learn more, +type + +``` +java -jar compiler.jar --help +``` + +More detailed information about running the Closure Compiler is available in the +[documentation](http://code.google.com/closure/compiler/docs/gettingstarted_app.html). + +## Compiling Multiple Scripts + +If you have multiple scripts, you should compile them all together with one +compile command. + +```bash +java -jar compiler.jar --js_output_file=out.js in1.js in2.js in3.js ... +``` + +You can also use minimatch-style globs. + +```bash +# Recursively include all js files in subdirs +java -jar compiler.jar --js_output_file=out.js 'src/**.js' + +# Recursively include all js files in subdirs, exclusing test files. +# Use single-quotes, so that bash doesn't try to expand the '!' +java -jar compiler.jar --js_output_file=out.js 'src/**.js' '!**_test.js' +``` + +The Closure Compiler will concatenate the files in the order they're passed at +the command line. + +If you're using globs or many files, you may start to run into +problems with managing dependencies between scripts. In this case, you should +use the [Closure Library](https://developers.google.com/closure/library/). It +contains functions for enforcing dependencies between scripts, and Closure Compiler +will re-order the inputs automatically. + +## How to Contribute +### Reporting a bug +1. First make sure that it is really a bug and not simply the way that Closure Compiler works (especially true for ADVANCED_OPTIMIZATIONS). + * Check the [official documentation](https://developers.google.com/closure/compiler/) + * Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ) + * Search on [Stack Overflow](http://stackoverflow.com/questions/tagged/google-closure-compiler) and in the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss) +2. If you still think you have found a bug, make sure someone hasn't already reported it. See the list of [known issues](https://github.com/google/closure-compiler/issues). +3. If it hasn't been reported yet, post a new issue. Make sure to add enough detail so that the bug can be recreated. The smaller the reproduction code, the better. + +### Suggesting a Feature +1. Consult the [FAQ](https://github.com/google/closure-compiler/wiki/FAQ) to make sure that the behaviour you would like isn't specifically excluded (such as string inlining). +2. Make sure someone hasn't requested the same thing. See the list of [known issues](https://github.com/google/closure-compiler/issues). +3. Read up on [what type of feature requests are accepted](https://github.com/google/closure-compiler/wiki/FAQ#how-do-i-submit-a-feature-request-for-a-new-type-of-optimization). +4. Submit your reqest as an issue. + +### Submitting patches +1. All contributors must sign a contributor license agreement. See the [CONTRIBUTORS](https://raw.githubusercontent.com/google/closure-compiler/master/CONTRIBUTORS) file for details. +2. To make sure your changes are of the type that will be accepted, ask about your patch on the [Closure Compiler Discuss Group](https://groups.google.com/forum/#!forum/closure-compiler-discuss) +3. Fork the repository. +4. Make your changes. +5. Submit a pull request for your changes. A project developer will review your work and then merge your request into the project. + +## Closure Compiler License + +Copyright 2009 The Closure Compiler Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## Dependency Licenses + +### Rhino + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Path + src/com/google/javascript/rhino, test/com/google/javascript/rhino +
URLhttp://www.mozilla.org/rhino
Version1.5R3, with heavy modifications
LicenseNetscape Public License and MPL / GPL dual license
DescriptionA partial copy of Mozilla Rhino. Mozilla Rhino is an +implementation of JavaScript for the JVM. The JavaScript +parse tree data structures were extracted and modified +significantly for use by Google's JavaScript compiler.
Local ModificationsThe packages have been renamespaced. All code not +relevant to the parse tree has been removed. A JsDoc parser and static typing +system have been added.
+ +### Args4j + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/args4j.jar
URLhttps://args4j.dev.java.net/
Version2.0.26
LicenseMIT
Descriptionargs4j is a small Java class library that makes it easy to parse command line +options/arguments in your CUI application.
Local ModificationsNone
+ +### Guava Libraries + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/guava.jar
URLhttp://code.google.com/p/guava-libraries/
Version18.0
LicenseApache License 2.0
DescriptionGoogle's core Java libraries.
Local ModificationsNone
+ +### JSR 305 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/jsr305.jar
URLhttp://code.google.com/p/jsr-305/
Versionsvn revision 47
LicenseBSD License
DescriptionAnnotations for software defect detection.
Local ModificationsNone
+ +### JUnit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/junit.jar
URLhttp://sourceforge.net/projects/junit/
Version4.11
LicenseCommon Public License 1.0
DescriptionA framework for writing and running automated tests in Java.
Local ModificationsNone
+ +### Protocol Buffers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/protobuf-java.jar
URLhttp://code.google.com/p/protobuf/
Version2.5.0
LicenseNew BSD License
DescriptionSupporting libraries for protocol buffers, +an encoding of structured data.
Local ModificationsNone
+ +### Ant + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Path + lib/ant.jar, lib/ant-launcher.jar +
URLhttp://ant.apache.org/bindownload.cgi
Version1.8.1
LicenseApache License 2.0
DescriptionAnt is a Java based build tool. In theory it is kind of like "make" +without make's wrinkles and with the full portability of pure java code.
Local ModificationsNone
+ +### JSON + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/json.jar
URLhttp://json.org/java/index.html
VersionJSON version 20090211
LicenseMIT license
DescriptionJSON is a set of java files for use in transmitting data in JSON format.
Local ModificationsNone
+ +### Mockito + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/mockito-core.jar
URLhttps://code.google.com/p/mockito
Version1.9.5
LicenseMIT license
DescriptionMockito is an open source testing framework for Java. The framework allows the +creation of Test Double objects (called "Mock Objects") in automated unit tests +for the purpose of Test-driven Development (TDD) or Behavior Driven Development +(BDD).
Local ModificationsNone
+ +### Objenesis + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathlib/objenesis.jar
URLhttp://objenesis.org
Version1.2
LicenseApache 2.0 license
DescriptionDepended by lib/mockito-core.jar, not used directly.
Local ModificationsNone
+ +### Node.js Closure Compiler Externs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code Pathcontrib/nodejs
URLhttps://github.com/dcodeIO/node.js-closure-compiler-externs
Versione891b4fbcf5f466cc4307b0fa842a7d8163a073a
LicenseApache 2.0 license
DescriptionType contracts for NodeJS APIs
Local ModificationsSubstantial changes to make them compatible with NpmCommandLineRunner.
diff --git a/utils/closure-compiler/closure-compiler.jar b/utils/closure-compiler/closure-compiler.jar new file mode 100644 index 0000000..8e52ef0 Binary files /dev/null and b/utils/closure-compiler/closure-compiler.jar differ diff --git a/utils/demon.sh b/utils/demon.sh new file mode 100755 index 0000000..e370791 --- /dev/null +++ b/utils/demon.sh @@ -0,0 +1,53 @@ +#!/usr/bin/bash + +LANG="en_US.utf8" + +function my_date { + date +"%d %b %T -" | tr '\n' ' ' +} + +function myecho { + my_date + echo $@ +} + +cd ../js +inotifywait -r -e close_write -m . | + while read path action file; do + if [ `find . -name $file | wc -l` -ne 0 ]; then + myecho -e "\033[32m[demonjs] Compiling...\033[0m" + make -j > /dev/null + if [ $? -eq 0 ]; then + my_date + echo -e "\033[32m[demonjs] Compilation successful\033[0m" + fi + fi + done & + +cd ../geo +inotifywait -r -e close_write -m . | + while read path action file; do + if [ `find . -name $file | wc -l` -ne 0 ]; then + myecho -e "\033[32m[demongeo] Compiling...\033[0m" + make -j > /dev/null + if [ $? -eq 0 ]; then + myecho -e "\033[32m[demongeo] Compilation successful\033[0m" + fi + fi + done & + +cd .. +nodemon server.js & + +echo "ok" + +function killit { + + killall inotifywait + # killall nodemon + +} + +trap "killit" SIGINT SIGTERM + +wait diff --git a/utils/compiler.sh b/utils/simple-compiler/compiler.sh similarity index 100% rename from utils/compiler.sh rename to utils/simple-compiler/compiler.sh