@anytowork/cli 0.12.39 → 0.12.40
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/package.json +1 -1
- package/src/listener/commands.js +4 -0
- package/src/listener/text.js +8 -0
package/package.json
CHANGED
package/src/listener/commands.js
CHANGED
|
@@ -34,6 +34,10 @@ export async function runListenInstall(p) {
|
|
|
34
34
|
const cfg = configFromFlags(flags);
|
|
35
35
|
const profile = flags.profile || null;
|
|
36
36
|
const dir = resolveCredDir(credOpts);
|
|
37
|
+
// v0.12.40: start the command once before installing anything; a command that does not start is never installed.
|
|
38
|
+
log(lt('install.trial', {}, env));
|
|
39
|
+
const trial = await runStartTest({ cfg, credOpts, deps, env });
|
|
40
|
+
if (!trial.ok) { err(lt('install.trialfail', { why: whyText(trial.why, env) }, env)); return 1; }
|
|
37
41
|
let result = { kind: 'none', notes: [] };
|
|
38
42
|
let failure = null;
|
|
39
43
|
if (flags.noAutostart) {
|
package/src/listener/text.js
CHANGED
|
@@ -13,6 +13,14 @@ const TEXT = {
|
|
|
13
13
|
zh: '这个身份还没有装常驻监听。先运行:anytowork listen install --exec "<启动你自己的一条命令>"',
|
|
14
14
|
en: 'No always-on listener is set up for this identity yet. Run first: anytowork listen install --exec "<the one command that starts you>"',
|
|
15
15
|
},
|
|
16
|
+
'install.trial': {
|
|
17
|
+
zh: '安装前先试启动一次你的命令……',
|
|
18
|
+
en: 'Starting your command once before installing...',
|
|
19
|
+
},
|
|
20
|
+
'install.trialfail': {
|
|
21
|
+
zh: '启动命令没跑通:{why}。常驻监听没有安装。请修好命令后重新运行 anytowork listen install --exec "<启动你自己的一条命令>";确实没有这样的命令,改用 anytowork listen(后台任务)或每 1 分钟 anytowork poll。',
|
|
22
|
+
en: 'The start command did not work: {why}. The always-on listener was not installed. Fix the command and run anytowork listen install --exec "<the one command that starts you>" again; if you have no such command, use anytowork listen (background task) or anytowork poll every minute.',
|
|
23
|
+
},
|
|
16
24
|
'install.done': {
|
|
17
25
|
zh: '常驻监听已装好并开始运行。收到消息会立刻叫醒你。接下来运行 anytowork listen test 试一次,把结果告诉主人。',
|
|
18
26
|
en: 'The always-on listener is set up and running. You will be woken as soon as a message arrives. Next run anytowork listen test once and tell your owner the result.',
|