mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-26 21:42:11 +00:00
This commit is contained in:
parent
f5a536a920
commit
b6b4bf9ec7
1 changed files with 9 additions and 4 deletions
|
|
@ -102,6 +102,13 @@ namespace Cosmos.Build.Installer {
|
||||||
CurrPath = aPath;
|
CurrPath = aPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetReadOnly(string aPathname) {
|
||||||
|
var xAttrib = File.GetAttributes(aPathname);
|
||||||
|
if ((xAttrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
|
||||||
|
File.SetAttributes(aPathname, xAttrib & ~FileAttributes.ReadOnly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Copy(string aSrcPathname) {
|
public void Copy(string aSrcPathname) {
|
||||||
Copy(aSrcPathname, Path.GetFileName(aSrcPathname));
|
Copy(aSrcPathname, Path.GetFileName(aSrcPathname));
|
||||||
}
|
}
|
||||||
|
|
@ -116,11 +123,9 @@ namespace Cosmos.Build.Installer {
|
||||||
|
|
||||||
// TODO: Make overwrite a param and make this part of the logic
|
// TODO: Make overwrite a param and make this part of the logic
|
||||||
// Copying files that are in TFS often they will be read only, so need to kill this file before copy
|
// Copying files that are in TFS often they will be read only, so need to kill this file before copy
|
||||||
var xAttrib = File.GetAttributes(xDest);
|
ResetReadOnly(xDest);
|
||||||
if ((xAttrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
|
|
||||||
File.SetAttributes(xDest, xAttrib & ~FileAttributes.ReadOnly);
|
|
||||||
}
|
|
||||||
File.Copy(xSrc, xDest, true);
|
File.Copy(xSrc, xDest, true);
|
||||||
|
ResetReadOnly(xDest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Echo() {
|
public void Echo() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue