public static void DeleteIfExistsAndCreateDirectory(this IShell shell, AbsoluteDirectoryPath directory) { if (shell.Exists(directory)) { shell.Delete(directory); } shell.Create(directory); }
public string GetUserWhoRanDaemonLastTime() { try { if (!_fs.Exists(_userFile)) { return(GetUserName()); } return(_fs.ReadAllText(_userFile, 10)); } catch (ArgumentException e) { _errorWriter.WriteLine(e.InnerException); return(GetUserName()); } catch (Exception e) { _errorWriter.WriteLine(e); return(GetUserName()); } }
bool HasCustomDevicesFile(AbsoluteDirectoryPath projDir) { return(_fileSystem.Exists(CustomDevicesFile(projDir))); }