Have build script create .env if not found
This commit is contained in:
parent
60bec5592a
commit
c98a6d59f4
1 changed files with 4 additions and 1 deletions
5
build.rs
5
build.rs
|
@ -34,7 +34,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let mut path = PathBuf::from_str(&project_root)?;
|
let mut path = PathBuf::from_str(&project_root)?;
|
||||||
path.push(".env");
|
path.push(".env");
|
||||||
|
|
||||||
let mut file = std::fs::OpenOptions::new().append(true).open(path)?;
|
let mut file = std::fs::OpenOptions::new()
|
||||||
|
.append(true)
|
||||||
|
.create(true)
|
||||||
|
.open(path)?;
|
||||||
file.write_all(b"\nDATABASE_URL=sqlite:./cache/metadata.sqlite\n")?;
|
file.write_all(b"\nDATABASE_URL=sqlite:./cache/metadata.sqlite\n")?;
|
||||||
file.sync_all()?;
|
file.sync_all()?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue