Skip to content

Commit a7510b6

Browse files
committed
f
1 parent e083a72 commit a7510b6

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ developer-mode: setup-dev
7373
./os/developer-mode/configure.mjs
7474

7575
reset: base setup
76-
rm /home/pi/config.json
77-
rm /home/pi/hardware.json
78-
rm /home/pi/calibration.json
76+
rm /home/pi/PlanktoScope/config.json
77+
rm /home/pi/PlanktoScope/hardware.json
78+
rm /home/pi/PlanktoScope/calibration.json
7979
sudo reboot
8080

8181
install-uv:

lib/file-config.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { rm, writeFile } from "fs/promises"
1+
import { rm, writeFile, mkdir } from "fs/promises"
22
import { readFile, access, constants, copyFile } from "fs/promises"
33

4-
const HARDWARE_PATH = "/home/pi/hardware.json"
5-
const SOFTWARE_PATH = "/home/pi/config.json"
6-
const CALIBRATION_PATH = "/home/pi/calibration.json"
4+
const HARDWARE_PATH = "/home/pi/PlanktoScope/hardware.json"
5+
const SOFTWARE_PATH = "/home/pi/PlanktoScope/config.json"
6+
const CALIBRATION_PATH = "/home/pi/PlanktoScope/calibration.json"
77
const CALIBRATION_DEFAULTS_PATH =
88
"/opt/PlanktoScope/default-configs/calibration.json"
99

@@ -17,14 +17,16 @@ async function hasConfig(path) {
1717
}
1818

1919
export async function initConfigFiles(hardware_version) {
20+
await mkdir("/home/pi/PlanktoScope")
21+
2022
await Promise.all([
2123
copyFile(
2224
`/opt/PlanktoScope/default-configs/${hardware_version}.config.json`,
23-
"/home/pi/config.json",
25+
SOFTWARE_PATH,
2426
),
2527
copyFile(
2628
`/opt/PlanktoScope/default-configs/${hardware_version}.hardware.json`,
27-
"/home/pi/hardware.json",
29+
HARDWARE_PATH,
2830
),
2931
// Create calibration.json from defaults if it doesn't exist yet.
3032
// Unlike config/hardware, this never overwrites — preserving user calibrations.

os/preimage.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ rm -f "$HOME"/.gitconfig
1818
rm -rf "$HOME"/.ssh
1919
rm -rf "$HOME"/data
2020
rm -f "$HOME"/filebrowser.db
21-
rm -f "$HOME"/planktoScope/hardware.json
21+
rm -f "$HOME"/PlanktoScope/hardware.json
2222
rm -f "$HOME"/PlanktoScope/config.json
23+
rm -f "$HOME"/PlanktoScope/calibartion.json
2324

2425
# Clear machine-id so that it will be regenerated on the next boot
2526
# This is also the condition for ConditionFirstBoot=yes

0 commit comments

Comments
 (0)