@ps-aux/nodebup 0.8.1 → 0.9.0
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.
package/lib/cli/app.js
CHANGED
@@ -101,14 +101,22 @@ const createApp = () => _nclif.CliApp.of({
|
|
101
101
|
|
102
102
|
exports.createApp = createApp;
|
103
103
|
const restic = (0, _nclif.cmdGroup)({
|
104
|
+
options: singleStorageOptions,
|
104
105
|
commands: {
|
105
106
|
'init-repo': (0, _nclif.cmd)({
|
106
|
-
options: singleStorageOptions,
|
107
107
|
run: (_, c) => c.get(_ResticController.ResticController).initRepo()
|
108
108
|
}),
|
109
109
|
snapshots: (0, _nclif.cmd)({
|
110
|
-
options: singleStorageOptions,
|
111
110
|
run: (_, c, p) => c.get(_ResticController.ResticController).listSnapshots(p.stdout)
|
111
|
+
}),
|
112
|
+
cmd: (0, _nclif.cmd)({
|
113
|
+
positionals: [{
|
114
|
+
name: 'cmd',
|
115
|
+
required: true
|
116
|
+
}],
|
117
|
+
run: ({
|
118
|
+
cmd
|
119
|
+
}, c, p) => c.get(_ResticController.ResticController).runResticCmd(cmd, p.stdout)
|
112
120
|
})
|
113
121
|
}
|
114
122
|
});
|
@@ -34,6 +34,12 @@ class ResticClient {
|
|
34
34
|
});
|
35
35
|
});
|
36
36
|
|
37
|
+
_defineProperty(this, "runCmd", cmd => {
|
38
|
+
return this.shell.execAndReturnBuffer(`restic ${cmd}`, {
|
39
|
+
env: this.env()
|
40
|
+
});
|
41
|
+
});
|
42
|
+
|
37
43
|
_defineProperty(this, "backup", (cwd, from, tags = []) => {
|
38
44
|
this.log.debug(`Running backup for repo=${this.url}`);
|
39
45
|
let cmd = `restic backup ${from.str()}`;
|
@@ -48,6 +48,11 @@ let ResticController = (_dec = (0, _inversify.injectable)(), _dec2 = function (t
|
|
48
48
|
const res = this.client().snapshots();
|
49
49
|
print(JSON.stringify(res, null, 4));
|
50
50
|
});
|
51
|
+
|
52
|
+
_defineProperty(this, "runResticCmd", (cmd, print) => {
|
53
|
+
const res = this.client().runCmd(cmd);
|
54
|
+
print(res.toString());
|
55
|
+
});
|
51
56
|
}
|
52
57
|
|
53
58
|
}) || _class) || _class) || _class) || _class);
|