esv: remove invalid path checks
They're catering to too much of an edge case. It can just be checked with std.file.exists() later on.
This commit is contained in:
parent
bf3eb2953a
commit
f540160ff3
1 changed files with 1 additions and 5 deletions
6
esv.d
6
esv.d
|
@ -24,7 +24,7 @@ import std.conv : to, ConvException;
|
|||
import std.file : exists, mkdirRecurse, write, FileException;
|
||||
import std.format : format;
|
||||
import std.getopt : getopt, GetOptException;
|
||||
import std.path : baseName, dirName, expandTilde, isValidPath;
|
||||
import std.path : baseName, dirName, expandTilde;
|
||||
import std.process : environment, executeShell;
|
||||
import std.stdio : writeln, writefln;
|
||||
import std.string : splitLines;
|
||||
|
@ -107,12 +107,8 @@ config:
|
|||
.expandTilde();
|
||||
try {
|
||||
if (CFlag != "") { /* if -C was given */
|
||||
enforceDie(CFlag.isValidPath(), CFlag ~ ": invalid path");
|
||||
configPath = CFlag.expandTilde();
|
||||
} else {
|
||||
enforceDie(configPath.isValidPath(),
|
||||
configPath ~ ": invalid path");
|
||||
|
||||
if (!configPath.exists()) {
|
||||
mkdirRecurse(dirName(configPath));
|
||||
configPath.write(format!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue