mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-27 13:50:02 +03:00
add dscanner fix
command
This commit is contained in:
parent
48cec8a6f4
commit
4194e6af0c
8 changed files with 371 additions and 60 deletions
|
@ -80,6 +80,19 @@ ubyte[] readFile(string fileName)
|
|||
return sourceCode;
|
||||
}
|
||||
|
||||
void writeFileSafe(string filename, scope const(ubyte)[] content)
|
||||
{
|
||||
import std.file : copy, PreserveAttributes, remove, write;
|
||||
import std.path : baseName, buildPath, dirName;
|
||||
|
||||
string tempName = buildPath(filename.dirName, "." ~ filename.baseName ~ "~");
|
||||
|
||||
// FIXME: we are removing the optional BOM here
|
||||
copy(filename, tempName, PreserveAttributes.yes);
|
||||
write(filename, content);
|
||||
remove(tempName);
|
||||
}
|
||||
|
||||
string[] expandArgs(string[] args)
|
||||
{
|
||||
import std.file : isFile, FileException, dirEntries, SpanMode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue