Skip to content

Commit

Permalink
fix hft cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 19, 2014
1 parent 34ede41 commit 1b6e0e8
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cli/cmds/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var Promise = require('promise');

var add = function(args) {
return new Promise(function(resolve, reject) {
var fullPath = args._.length > 1 ? path.resolve(args._[1]) : process.cwd();
var fullPath = args._.length > 0 ? path.resolve(args._[0]) : process.cwd();
if (games.add(fullPath) === false) {
reject();
} else {
Expand Down
4 changes: 2 additions & 2 deletions cli/cmds/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var utils = require('../utils');

var download = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length < 2) {
if (args._.length < 1) {
utils.badArgs(module, "missing gameId");
reject();
return;
}

if (args._.length > 2) {
if (args._.length > 1) {
utils.badArgs(module, "too many arguments");
reject();
return;
Expand Down
2 changes: 1 addition & 1 deletion cli/cmds/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var utils = require('../utils');

var init = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length != 1) {
if (args._.length != 0) {
utils.badArgs(module, "bad args");
reject();
}
Expand Down
4 changes: 2 additions & 2 deletions cli/cmds/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ var utils = require('../utils');

var install = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length < 2) {
if (args._.length < 1) {
utils.badArgs(module, "missing srcPath");
}

if (args._.length > 2) {
if (args._.length > 1) {
utils.badArgs(module, "too many arguments");
}

Expand Down
4 changes: 2 additions & 2 deletions cli/cmds/make-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var utils = require('../utils');

var makeRelease = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length < 2) {
if (args._.length < 1) {
utils.badArgs(module, "missing dstPath");
reject();
return;
}

if (args._.length > 2) {
if (args._.length > 1) {
utils.badArgs(module, "too many arguments");
reject();
return;
Expand Down
2 changes: 1 addition & 1 deletion cli/cmds/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var askPrompt = function(questions) {

var publish = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length != 1) {
if (args._.length != 0) {
utils.badArgs(module, "too many arguments");
reject();
return;
Expand Down
4 changes: 2 additions & 2 deletions cli/cmds/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var utils = require('../utils');

var uninstall = function(args) {
return new Promise(function(resolve, reject) {
if (args._.length < 2) {
if (args._.length < 1) {
utils.badArgs(module, "missing path or gameId");
reject();
return;
}

if (args._.length > 2) {
if (args._.length > 1) {
utils.badArgs(module, "too many arguments");
reject();
return;
Expand Down
8 changes: 8 additions & 0 deletions docs/api-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,12 @@ the correct version

For a working example see [http://github.com/greggman/hft-simple-script](http://github.com/greggman/hft-simple-script)

* Fix for Unity Games on Windows

You need to upgrade old Unity Games to the latest .dlls.
[Download the .dll here](https://github.com/greggman/hft-unity3d/releases)
You'll also need the latest version of happyFunTimes. At least verison 0.0.9.
[Download here](http://superhappyfuntimes.net/install)



18 changes: 9 additions & 9 deletions test/client/roundtrip-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
*/
"use strict";

var assert = require('assert');
var path = require('path');
var should = require('should');
var testUtils = require('../../lib/test/test-utils');
var TestWebSocketClient = require('../../lib/test/test-websocketclient');
var TestGame = require('../../lib/test/test-game');
var TestController = require('../../lib/test/test-controller');
var assert = require('assert');
var path = require('path');
var should = require('should');
var testUtils = require('../../lib/test/test-utils');
var TestGame = require('../../lib/test/test-game');
var TestController = require('../../lib/test/test-controller');
var WebSocketClient = require('../../lib/websocketclient');

var g_configPath = path.join(__dirname, "..", "testgames", "config.json");
var g_installedGamesListPath = path.join(__dirname, "..", "testgames", "installed-games.json");
Expand All @@ -60,11 +60,11 @@ describe('roundtrip', function() {
//
// testUtils.createServer().then(function(result) {
// server = result;
// gameSocket = new TestWebSocketClient({url: "ws://localhost:8087"});
// gameSocket = new WebSocketClient({url: "ws://localhost:8087"});
// game = new TestGame({
// socket: gameSocket,
// });
// controllerSocket = new TestWebSocketClient({url: "ws://localhost:8087"});
// controllerSocket = new WebSocketClient({url: "ws://localhost:8087"});
// controller = new TestController({
// socket: controllerSocket,
// });
Expand Down

0 comments on commit 1b6e0e8

Please sign in to comment.