Skip to content

Commit 89577c7

Browse files
Fix prepublish script
Fix prepublish script to transpile `.ts` files only when the ios-sim.ts file exists. This will allow us to call `npm publish <path to ios-sim-portable.tgz>` without `--ignore-scripts` option as it is removing all scripts from package.json section.
1 parent d77457e commit 89577c7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

prepublish.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
var fs = require("fs");
2-
var grunt = require("grunt");
1+
var fs = require("fs"),
2+
path = require("path"),
3+
grunt = require("grunt");
34

4-
var callback = function(err) {};
5+
var pathToTypeScriptEntryPoint = path.join(__dirname, "lib", "ios-sim.ts");
6+
if (fs.existsSync(pathToTypeScriptEntryPoint)) {
7+
var callback = function(err) {};
58

6-
grunt.cli.tasks = ["ts:devlib"];
7-
grunt.cli(null, callback);
9+
grunt.cli.tasks = ["ts:devlib"];
10+
grunt.cli(null, callback);
11+
}

0 commit comments

Comments
 (0)