@bitakit/core 0.3.0 → 0.3.1
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.
|
@@ -93,6 +93,10 @@ export function createExecutor(setPending, owners, environment, get, resolve, up
|
|
|
93
93
|
return result;
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
96
|
+
// A run whose signal was aborted (a newer `latest` run took over, or its registration went
|
|
97
|
+
// away) usually rejects with that abort. It was stopped on purpose: not a failure to report.
|
|
98
|
+
if (controller.signal.aborted)
|
|
99
|
+
return skip('cancelled');
|
|
96
100
|
status = ActionStatus.Failed;
|
|
97
101
|
failure = error;
|
|
98
102
|
lifecycle.emit({ id, context, phase: 'failed', error });
|
|
@@ -158,7 +158,15 @@ export function adaptAction(resolved, host, config, events, available = () => tr
|
|
|
158
158
|
const request = evaluate(definition.confirm, context.input);
|
|
159
159
|
if (!request)
|
|
160
160
|
return undefined;
|
|
161
|
-
const
|
|
161
|
+
const { title, description, ...rest } = typeof request === 'string' ? { title: request, description: '' } : request;
|
|
162
|
+
// Like an Action's title: the text itself as a catalog key, then `<id>.confirm.title`
|
|
163
|
+
// and `.description`, then the literal.
|
|
164
|
+
const text = (value, part) => host.text(value, host.text(`${definition.id}.confirm.${part}`, value));
|
|
165
|
+
const accepted = await host.confirm({
|
|
166
|
+
...rest,
|
|
167
|
+
title: text(title, 'title'),
|
|
168
|
+
description: description ? text(description, 'description') : description,
|
|
169
|
+
});
|
|
162
170
|
return accepted ? undefined : CANCEL;
|
|
163
171
|
}
|
|
164
172
|
: undefined;
|