Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

detach bash on windows. #431

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
"grunt-curl": "0.5.0",
"grunt-shell": "0.2.1",
"q": "0.9.2",
"adm-zip": "0.4.4",
"semver": "2.0.11"
},
"scripts": {
"preinstall": "bash -c 'mv appshell.gyp .appshell.gyp'",
"preinstall": "node -e \"var fs=require('fs');var n='appshell.gyp';fs.renameSync(n,'.'+n);\"",
"install": "",
"postinstall": "bash -c 'mv .appshell.gyp appshell.gyp;'"
"postinstall": "node -e \"var fs=require('fs');var n='appshell.gyp';fs.renameSync('.'+n,n);\""
}
}
17 changes: 15 additions & 2 deletions tasks/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/
/*jslint vars:true*/
/*global module, require, process*/
/*global module, require, process, setTimeout*/
module.exports = function (grunt) {
"use strict";

Expand All @@ -30,6 +30,7 @@ module.exports = function (grunt) {
child_process = require("child_process"),
path = require("path"),
q = require("q"),
AdmZip = require('adm-zip'),
/* win only (lib), mac only (Resources, tools) */
CEF_MAPPING = {
"deps/cef/Debug" : "Debug",
Expand Down Expand Up @@ -64,7 +65,17 @@ module.exports = function (grunt) {

function unzip(src, dest) {
grunt.verbose.writeln("Extracting " + src);
return exec("unzip -q " + src + " -d " + dest);
var deferred = q.defer();
var zip = new AdmZip(src);
setTimeout(function() {
try {
zip.extractAllTo(dest);
deferred.resolve();
} catch(err) {
deferred.reject(err);
}
});
return deferred.promise;
}

// task: cef
Expand Down Expand Up @@ -317,6 +328,8 @@ module.exports = function (grunt) {

if (platform === "linux") {
gypCommand = "bash -c 'python2 gyp/gyp --depth=.'";
} else if (platform === "win") {
gypCommand = "cmd /C \"gyp\\gyp appshell.gyp -I common.gypi --depth=.\"";
} else {
gypCommand = "bash -c 'gyp/gyp appshell.gyp -I common.gypi --depth=.'";
}
Expand Down