Skip to content

Commit fe95da7

Browse files
committed
add access time to checks so rename file is caught
1 parent 81488de commit fe95da7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/services/project-changes-service.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class ProjectChangesService implements IProjectChangesService {
4343
private _newFiles: number = 0;
4444
private _outputProjectMtime: number;
4545
private _outputProjectCTime: number;
46+
private _outputProjectATime: number;
4647

4748
constructor(
4849
private $platformsData: IPlatformsData,
@@ -160,6 +161,7 @@ export class ProjectChangesService implements IProjectChangesService {
160161
let prepareInfoFile = path.join(platformData.projectRoot, prepareInfoFileName);
161162
this._outputProjectMtime = this.$fs.getFsStats(prepareInfoFile).mtime.getTime();
162163
this._outputProjectCTime = this.$fs.getFsStats(prepareInfoFile).ctime.getTime();
164+
this._outputProjectATime = this.$fs.getFsStats(prepareInfoFile).atime.getTime();
163165
return false;
164166
}
165167

@@ -175,6 +177,7 @@ export class ProjectChangesService implements IProjectChangesService {
175177

176178
this._outputProjectMtime = 0;
177179
this._outputProjectCTime = 0;
180+
this._outputProjectATime = 0;
178181
this._changesInfo = this._changesInfo || new ProjectChangesInfo();
179182
this._changesInfo.appFilesChanged = true;
180183
this._changesInfo.appResourcesChanged = true;
@@ -227,11 +230,9 @@ export class ProjectChangesService implements IProjectChangesService {
227230

228231
let fileStats = this.$fs.getFsStats(filePath);
229232

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;
234-
}
233+
let changed = fileStats.mtime.getTime() >= this._outputProjectMtime ||
234+
fileStats.ctime.getTime() >= this._outputProjectCTime ||
235+
fileStats.atime.getTime() >= this._outputProjectATime;
235236

236237
if (changed) {
237238
if (processFunc) {

0 commit comments

Comments
 (0)