Skip to content

Commit 11f6a10

Browse files
committed
Fix hook import path.
1 parent 684e656 commit 11f6a10

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = function ($usbLiveSyncService) {
2-
$usbLiveSyncService.forceExecuteFullSync = true;
2+
$usbLiveSyncService.forceExecuteFullSync = true;
33
};
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use strict";
22
var fs = require("fs");
33
var path = require("path");
4-
function findProjectDir() {
4+
5+
exports.findProjectDir = function findProjectDir() {
56
var candidateDir = path.join(__dirname, "..");
67
while (true) {
78
var oldCandidateDir = candidateDir;
@@ -17,17 +18,16 @@ function findProjectDir() {
1718
return;
1819
}
1920
}
20-
}
21-
exports.findProjectDir = findProjectDir;
22-
function getHooksDir() {
23-
return path.join(findProjectDir(), 'hooks');
24-
}
25-
exports.getHooksDir = getHooksDir;
26-
function gerBeforeLivesyncHookDir() {
27-
return path.join(getHooksDir(), "before-livesync");
28-
}
29-
exports.gerBeforeLivesyncHookDir = gerBeforeLivesyncHookDir;
30-
function getHookFilePath() {
31-
return path.join(gerBeforeLivesyncHookDir(), "nativescript-restart-on-sync-plugin.js");
32-
}
33-
exports.getHookFilePath = getHookFilePath;
21+
};
22+
23+
exports.getHooksDir = function getHooksDir() {
24+
return path.join(exports.findProjectDir(), 'hooks');
25+
};
26+
27+
exports.getBeforeLivesyncHookDir = function getBeforeLivesyncHookDir() {
28+
return path.join(exports.getHooksDir(), "before-livesync");
29+
};
30+
31+
exports.getHookFilePath = function getHookFilePath() {
32+
return path.join(exports.getBeforeLivesyncHookDir(), "nativescript-angular-sync .js");
33+
};

src/nativescript-angular/postinstall.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ var fs = require("fs");
22
var os = require("os");
33
var hookHelper = require("./hooks/hook-helper");
44
var projectDir = hookHelper.findProjectDir();
5+
56
if (projectDir) {
67
var hooksDir = hookHelper.getHooksDir(),
7-
beforeLivesyncHookDir = hookHelper.gerBeforeLivesyncHookDir(),
8-
content = 'module.exports = require("nativescript-restart-on-sync-plugin/hooks/before-livesync");';
8+
beforeLivesyncHookDir = hookHelper.getBeforeLivesyncHookDir(),
9+
content = 'module.exports = require("nativescript-angular/hooks/before-livesync");';
910
if (!fs.existsSync(hooksDir)) {
1011
fs.mkdirSync(hooksDir);
1112
}

0 commit comments

Comments
 (0)