Skip to content

Commit eda70b0

Browse files
committed
fix(system-settings): correctly handle newline for garuda-update settings
Closes #11
1 parent 46b6f31 commit eda70b0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/renderer/src/app/components/task-manager/os-interact.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,12 @@ export class OsInteractService {
546546
script += `if grep -q "^${key}=" "$CONFIG_FILE" 2>/dev/null; then\n`;
547547
script += ` sed -i 's|^${key}=.*|${key}=1|' "$CONFIG_FILE"\n`;
548548
script += `else\n`;
549+
script += ` [ -f "$CONFIG_FILE" ] && [ -n "$(tail -c1 "$CONFIG_FILE")" ] && echo >> "$CONFIG_FILE"\n`;
549550
script += ` echo "${key}=1" >> "$CONFIG_FILE"\n`;
550551
script += `fi\n`;
551552
} else {
552553
script += `if grep -q "^${key}=" "$CONFIG_FILE" 2>/dev/null; then\n`;
553-
script += ` sed -i 's|^${key}=.*|# ${key}=1 |' "$CONFIG_FILE"\n`;
554+
script += ` sed -i 's|^${key}=.*|# ${key}=1|' "$CONFIG_FILE"\n`;
554555
script += `fi\n`;
555556
}
556557
}

0 commit comments

Comments
 (0)