addtype-767589: Expose addType and removeType

Signed-off-by: Joe Walker <jwalker@mozilla.com>
Merge branch 'addtype-767589' into landing
exec-754315: Enable stripping of strings from gcli.properties

Some commands are included in the web build of GCLI, but not in the
Firefox build, so we need a way to exclude their strings from
gcli.properties.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
exec-754315: Update host.exec() function

Previously the code didn't work at all. This adds a NodeJS version of
host and uses the same pre-define trick to make it work in Node over the
web version that we used for the help hack earlier.

This also updates to web version of host.exec to use XHR to call to the
web server to make the change. And the mozilla version to do nothing.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
exec-754315: Add new 'cd' and 'exec' commands

The 'exec' command uses the new host.exec() function.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
exec-754315: Store 'shell' environment in Requisition

System commands generally need access to a shared idea of a current
directory and a path. This promotes this to be stored by the Requistion.
It's not 100% clear that this is the best place for it, but it works
for now.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
exec-754315: Move 'git' back to demo, add 'hg'

Now there is a generalised away of doing exec, we should have the git
commands be part of the demo section. I've also added the hg stuff that
I hacked up recently. The commands are commented out because they don't
do anything particularly useful right now.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
Merge branch 'exec-754315' into landing
exec-754315: Pass errors on properly

Signed-off-by: Joe Walker <jwalker@mozilla.com>
Merge branch 'exec-754315' into landing
remotetest-874821: Test with several node servers

Better all round test coverage.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Refactor to extract test module

Previously it was required twice, the second time in a confusing way
which looked asynchronous, but must have been sync to work. This is
much simpler.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Enable automated server testing

Previously all CI tests were done using node or phantomjs without a
server, to enable us to test 2 GCLI instances talking to each other, we
add a server option.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Update travis config

Add sleep to continue testing

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Update travis config (2)

Remove node 0.11 because contextify doesn't seem to work with node 0.11 and try
an alternate way to go into background

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Fix gclitest index

Refactoring errors. It's a shame that Travis makes us push so often.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: More gclitest fixes

Properly check the shutdown case and better failure docs for phantom script

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Sync promise implementation with central

We were using an old version of the promise library from the add-on SDK
we're now in sync. This means we can:
* Convert from util.promised and util.all to the versions in Promise
* Remove those functions from util
* Set Promise._reportErrors=true in test mode

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Handle exceptions in helpers._exec

Previously they would bounce up and get lost.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
remotetest-874821: Simplify util.promiseEach

I suspected a bug with replies being reset, and the logic was confusing
so I refactored.

Signed-off-by: Joe Walker <jwalker@mozilla.com>