Skip to content

Commit 94eeebb

Browse files
committed
added special check for file changes on Mac
1 parent 81488de commit 94eeebb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/services/project-changes-service.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export class ProjectChangesService implements IProjectChangesService {
4747
constructor(
4848
private $platformsData: IPlatformsData,
4949
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
50-
private $fs: IFileSystem) {
50+
private $fs: IFileSystem,
51+
private $hostInfo: IHostInfo) {
5152
}
5253

5354
public get currentChanges(): IProjectChangesInfo {
@@ -227,10 +228,15 @@ export class ProjectChangesService implements IProjectChangesService {
227228

228229
let fileStats = this.$fs.getFsStats(filePath);
229230

230-
let changed = fileStats.mtime.getTime() >= this._outputProjectMtime || fileStats.ctime.getTime() >= this._outputProjectCTime;
231-
if (!changed) {
232-
let lFileStats = this.$fs.getLsStats(filePath);
233-
changed = lFileStats.mtime.getTime() >= this._outputProjectMtime || lFileStats.ctime.getTime() >= this._outputProjectCTime;
231+
let changed = fileStats.mtime.getTime() > this._outputProjectMtime ||
232+
fileStats.ctime.getTime() >= this._outputProjectCTime;
233+
234+
if (this.$hostInfo.isDarwin && !fileStats.isDirectory() && !changed) {
235+
const parentDirPath: string = path.dirname(filePath);
236+
const parentDirStat = this.$fs.getFsStats(parentDirPath);
237+
238+
changed = parentDirStat.mtime.getTime() > this._outputProjectMtime ||
239+
parentDirStat.ctime.getTime() >= this._outputProjectCTime;
234240
}
235241

236242
if (changed) {

0 commit comments

Comments
 (0)