mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 15:54:31 +01:00
better clear bin
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# MODE=debug
|
# MODE=debug
|
||||||
MODE=release
|
MODE=release
|
||||||
BIN=sphinx-key
|
BIN=clear
|
||||||
check_exists() {
|
check_exists() {
|
||||||
command -v "$1" > /dev/null
|
command -v "$1" > /dev/null
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ then
|
|||||||
echo "Make sure the ESP is connected with a data USB cable, and try again."
|
echo "Make sure the ESP is connected with a data USB cable, and try again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# esptool.py erase_flash &&
|
esptool.py erase_flash &&
|
||||||
git pull &&
|
git pull &&
|
||||||
cd factory &&
|
cd factory &&
|
||||||
cargo espflash flash --release --port $PORT &&
|
cargo espflash flash --release --port $PORT &&
|
||||||
|
|||||||
@@ -44,8 +44,34 @@ fn main() -> anyhow::Result<()> {
|
|||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
if path.is_dir() {
|
if path.is_dir() {
|
||||||
println!("PATH {}", path.display());
|
println!("PATH {}", path.display());
|
||||||
if let Err(_e) = fs::remove_dir_all(path) {
|
if let Err(e) = fs::remove_dir_all(path.clone()) {
|
||||||
println!("err removing dir");
|
println!("err removing dir {:?}", e);
|
||||||
|
// remove inner dirs too
|
||||||
|
for entry in fs::read_dir(path)? {
|
||||||
|
let entry = entry?;
|
||||||
|
let path = entry.path();
|
||||||
|
if path.is_dir() {
|
||||||
|
println!("INNER PATH {:?}", path.display());
|
||||||
|
if let Err(e) = fs::remove_dir_all(path) {
|
||||||
|
println!("err removing inner dir {:?}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let dir = Path::new(ROOT_STORE);
|
||||||
|
println!("root store is dir {}", dir.is_dir());
|
||||||
|
if dir.is_dir() {
|
||||||
|
for entry in fs::read_dir(dir)? {
|
||||||
|
let entry = entry?;
|
||||||
|
let path = entry.path();
|
||||||
|
if path.is_dir() {
|
||||||
|
println!("PATH {}", path.display());
|
||||||
|
if let Err(e) = fs::remove_dir_all(path.clone()) {
|
||||||
|
println!("err removing dir {:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user