faces-cli 1.8.3 → 1.8.4
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/dist/commands/style/revert.js +9 -12
- package/oclif.manifest.json +1226 -1226
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ import { BaseCommand } from '../../base.js';
|
|
|
3
3
|
import { FacesAPIError } from '../../client.js';
|
|
4
4
|
import { VERSIONS_PATH } from '../../style.js';
|
|
5
5
|
export default class StyleRevert extends BaseCommand {
|
|
6
|
-
static description = 'Go back to the style a face had before the last style:make.
|
|
7
|
-
'
|
|
8
|
-
'
|
|
6
|
+
static description = 'Go back to the style a face had before the last style:make. Two versions are kept per medium, so ' +
|
|
7
|
+
'this is a toggle: running it again returns to where you started. A face holds one style per medium, ' +
|
|
8
|
+
'so name which one with --medium when it has more than one. It changes how the face writes ' +
|
|
9
|
+
'immediately, so it asks first.';
|
|
9
10
|
static examples = [
|
|
10
11
|
'<%= config.bin %> <%= command.id %> alice --yes',
|
|
11
12
|
'<%= config.bin %> <%= command.id %> alice --medium email --yes',
|
|
@@ -50,13 +51,6 @@ export default class StyleRevert extends BaseCommand {
|
|
|
50
51
|
if (err.statusCode === 409) {
|
|
51
52
|
this.error(`Error (409): ${err.message}\nSee what is there: faces style:versions ${args.alias}`);
|
|
52
53
|
}
|
|
53
|
-
// Reverting a named medium currently fails this way even when the
|
|
54
|
-
// server itself reports can_revert: true (faces-backend-shared#590).
|
|
55
|
-
if (err.statusCode === 500) {
|
|
56
|
-
this.error(`Error (500): the server failed to revert '${args.alias}'.\n` +
|
|
57
|
-
'Reverting a per-medium style is currently broken upstream and nothing was changed. ' +
|
|
58
|
-
'Tracked as faces-backend-shared#590.');
|
|
59
|
-
}
|
|
60
54
|
this.error(`Error (${err.statusCode}): ${err.message}`);
|
|
61
55
|
}
|
|
62
56
|
throw err;
|
|
@@ -71,8 +65,11 @@ export default class StyleRevert extends BaseCommand {
|
|
|
71
65
|
else {
|
|
72
66
|
this.log(`'${args.alias}' reverted.`);
|
|
73
67
|
}
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
// Reverting again returns to where you started — it is a toggle between the
|
|
69
|
+
// two kept versions, not a walk backwards. Name the version it goes back to
|
|
70
|
+
// so the user does not have to hold it in their head.
|
|
71
|
+
const back = from === undefined ? '' : ` to return to version ${from}`;
|
|
72
|
+
this.log(`Run it again${back}. List versions: faces style:versions ${args.alias}`);
|
|
76
73
|
return data;
|
|
77
74
|
}
|
|
78
75
|
}
|