@shellus/way 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +4 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -157,13 +157,14 @@ function cronToSystemd(cron) {
157
157
  async function systemd(options) {
158
158
  const wayDir = process.env.WAY_DIR || `${process.env.HOME}/.way`;
159
159
  const config = loadConfig(wayDir, options.remote);
160
+ const wayPath = execSync("which way", { encoding: "utf-8" }).trim();
160
161
  const serviceContent = `[Unit]
161
162
  Description=Way Backup Service
162
163
  After=network.target
163
164
 
164
165
  [Service]
165
166
  Type=oneshot
166
- ExecStart=/usr/local/bin/way run
167
+ ExecStart=${wayPath} run
167
168
  Environment="WAY_DIR=${wayDir}"
168
169
  `;
169
170
  const timerContent = `[Unit]
@@ -194,7 +195,7 @@ WantedBy=timers.target
194
195
  execSync("systemctl --user enable way-backup.timer");
195
196
  execSync("systemctl --user start way-backup.timer");
196
197
  console.log("Systemd timer installed and started");
197
- execSync("systemctl --user status way-backup.timer", { stdio: "inherit" });
198
+ execSync("systemctl --user --no-pager status way-backup.timer", { stdio: "inherit" });
198
199
  }
199
200
  if (options.action === "uninstall") {
200
201
  try {
@@ -211,7 +212,7 @@ WantedBy=timers.target
211
212
  console.log("Systemd timer uninstalled");
212
213
  }
213
214
  if (options.action === "status") {
214
- execSync("systemctl --user status way-backup.timer", { stdio: "inherit" });
215
+ execSync("systemctl --user --no-pager status way-backup.timer", { stdio: "inherit" });
215
216
  }
216
217
  }
217
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shellus/way",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "将备份作为持续运营的项目,而非一次性任务。基于 restic 的策略封装。",
5
5
  "type": "module",
6
6
  "bin": {