Skip to content

Commit

Permalink
feat(ctl): use equals instead of string comparision
Browse files Browse the repository at this point in the history
  • Loading branch information
chyzwar committed Sep 20, 2024
1 parent 7f26ee9 commit 909a1b3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/ctl/src/ctl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,9 @@ export function create(unitName: string, unit: Unit) {
const path = getPath (name, type);

const current = getUnit(name, type);
const currentUnit = current?.toINIString();
const unitString = unit.toINIString();

// TODO use equal instead of !== to compare
if (currentUnit !== unitString) {
// TODO add file mode
writeFileSync(path, unitString);
if (unit.equals(current)) {
writeFileSync(path, unit.toINIString());
}
}

Expand Down

0 comments on commit 909a1b3

Please sign in to comment.