website/scripts/docsmg: Bug fixes (#10668)

* add docsmg tool

* moved to the correct scripts directory

* removed test files

* added install script and readme draft to docsmg

* fix install script

* fixed issues

* Revert "fixed issues"

This reverts commit a51192025f.

* Revert "Revert "fixed issues""

This reverts commit ab68918fea.

* added dotenv and updated readme

* fixed install script
This commit is contained in:
Bama
2024-07-28 21:32:29 -05:00
committed by GitHub
parent 270c9661a1
commit ca7705689d
8 changed files with 71 additions and 77 deletions

View File

@ -19,3 +19,17 @@ pub fn read_migrate_file(file: PathBuf) -> anyhow::Result<Vec<(PathBuf, PathBuf)
.collect::<Vec<_>>();
Ok(migrations)
}
pub fn read_migrate_file_left_side(file: PathBuf) -> anyhow::Result<Vec<PathBuf>> {
let contents = read_to_string(file)?;
let lines: Vec<String> = contents
.split('\n')
.map(|x| x.to_owned())
.filter(|x| x != "")
.collect();
let migrations = lines
.iter()
.map(|x| x.split(" -> ").collect::<Vec<&str>>()[0].into())
.collect::<Vec<_>>();
Ok(migrations)
}