writeTimestampFile function

Future writeTimestampFile(
  1. String timestampPath
)

Implementation

Future writeTimestampFile(String timestampPath) async {
  String servePath = fs.path.join(userRootPath(), 'bin', 'server.tar.gz');
  File timestampFile = fs.file(timestampPath);
  if (!timestampFile.existsSync()) {
    timestampFile.createSync(recursive: true);
  }
  DateTime time = fs.file(servePath).lastModifiedSync();
  String serveTimeValue = time.millisecondsSinceEpoch.toString();
  timestampFile = await timestampFile.writeAsString(serveTimeValue);
}