hydrooj-addons-manager 0.1.1 → 0.1.3

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/index.ts +11 -6
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -92,11 +92,16 @@ class AddonsManagerHandler extends Handler {
92
92
 
93
93
  // optional: better log formatting
94
94
  console.log(`[Addons Manager] Action=${pkg.action} Package=${pkg.name} Version=${pkg.version} Result=${JSON.stringify(result)}`);
95
- this.back({
96
- result: result,
97
- packages: packages,
98
- lockedPackages: lockedPackages
99
- });
95
+ if(result.success){
96
+ this.back({
97
+ result: result,
98
+ packages: packages,
99
+ lockedPackages: lockedPackages
100
+ });
101
+ }else {
102
+ throw new UserFacingError(result.message || 'Operation failed');
103
+ }
104
+
100
105
  }
101
106
  }
102
107
 
@@ -140,7 +145,7 @@ export default class AddonsManagerService extends Service {
140
145
  result = rmRes;
141
146
  break;
142
147
  case 'update':
143
- result = await sendCommand('yarn', ['global', 'upgrade', name + (version ? '@' + version : '')], config.pathToHydro);
148
+ result = await sendCommand('yarn', ['global', 'upgrade', name + (version ? '@' + version : ''), '--latest'], config.pathToHydro);
144
149
  break;
145
150
  case 'add':
146
151
  await sendCommand('yarn', ['global', 'add', name + (version ? '@' + version : '')], config.pathToHydro);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hydrooj-addons-manager",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "addons manager for hydrooj",
5
5
  "main": "index.ts",
6
6
  "author": "https://github.com/Bryan0324",