Skip to content

Commit b079c98

Browse files
Nathanael AndersonNathanWalker
authored andcommitted
Fix Script from TNS Buggy install behavior while installing TNS template. (#99)
1 parent e7c144a commit b079c98

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

scripts/postinstall.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/*************************************************************************************
22
* Licensed under the APACHE license
33
*
4-
* Version 0.0.5 Nathan@master-technology.com
4+
* Version 0.0.6 Nathan@master-technology.com
55
************************************************************************************/
66
"use strict";
77

88
// Simple require statements, built into node
99
var fs = require('fs');
1010
var path = require('path');
11+
var os = require('os');
1112

13+
// Check for the Buggy TNS Behavior...
14+
checkIfTNSBug();
1215

1316
// Do we have detect SCSS support
1417
var hasSCSS = false;
@@ -130,4 +133,24 @@ function mkRecursiveDirectories(path) {
130133
if (fs.existsSync(newPath)) { continue; }
131134
fs.mkdirSync(newPath);
132135
}
136+
}
137+
138+
/**
139+
* Check for The TNS double install buggy behavior...
140+
*/
141+
function checkIfTNSBug() {
142+
var cwd = process.cwd();
143+
if (cwd.indexOf(os.tmpdir()) === 0) {
144+
process.exit(0);
145+
}
146+
147+
var env = process.env["TMP"];
148+
if (env && process.argv[1].indexOf(env) === 0) {
149+
process.exit(0);
150+
}
151+
152+
env = process.env["TEMP"];
153+
if (env && process.argv[1].indexOf(env) === 0) {
154+
process.exit(0);
155+
}
133156
}

0 commit comments

Comments
 (0)