Skip to content

Commit 2ca9cf0

Browse files
Ievgenii.MykhalevskyiIevgenii.Mykhalevskyi
Ievgenii.Mykhalevskyi
authored and
Ievgenii.Mykhalevskyi
committed
added update package deps command
1 parent 6c8a2d0 commit 2ca9cf0

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ npm run test
1717

1818
vsce package
1919

20-
code --install-extension vscode-ios-0.4.1.vsix
20+
code --install-extension vscode-ios-0.4.2.vsix

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"test",
4343
"coverage"
4444
],
45-
"version": "0.4.1",
45+
"version": "0.4.2",
4646
"os": [
4747
"darwin"
4848
],
@@ -190,11 +190,11 @@
190190
"commands": [
191191
{
192192
"command": "vscode-ios.tools.install",
193-
"title": "iOS: Install Dependencies"
193+
"title": "iOS: Install Extension Dependencies"
194194
},
195195
{
196196
"command": "vscode-ios.tools.update",
197-
"title": "iOS: Update Dependencies"
197+
"title": "iOS: Update Extensions Dependencies"
198198
},
199199
{
200200
"command": "vscode-ios.project.select",
@@ -266,6 +266,10 @@
266266
{
267267
"command": "vscode-ios.run.project.reload",
268268
"title": "iOS: Project: Reload"
269+
},
270+
{
271+
"command": "vscode-ios.run.project.update.deps",
272+
"title": "iOS: Project: Update Package Dependencies"
269273
}
270274
],
271275
"languages": [

src/commands.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ export async function selectDevice(commandContext: CommandContext, ignoreFocusOu
273273
}
274274
}
275275

276+
export async function updatePackageDependencies(commandContext: CommandContext, check = true) {
277+
if (check) {
278+
await checkWorkspace(commandContext);
279+
}
280+
const buildManager = new BuildManager();
281+
await buildManager.checkFirstLaunchStatus(commandContext);
282+
// at this point everything is set
283+
commandContext.projectSettingsProvider.projectEnv.firstLaunchedConfigured = true;
284+
}
285+
276286
export async function checkWorkspace(commandContext: CommandContext, ignoreFocusOut = false) {
277287
try {
278288
let validProjectScheme: boolean = false;
@@ -325,11 +335,8 @@ export async function checkWorkspace(commandContext: CommandContext, ignoreFocus
325335
await generateXcodeServer(commandContext, false);
326336
}
327337
if (commandContext.projectSettingsProvider.projectEnv.firstLaunchedConfigured === false) {
328-
const buildManager = new BuildManager();
329-
await buildManager.checkFirstLaunchStatus(commandContext);
338+
updatePackageDependencies(commandContext, false);
330339
}
331-
// at this point everything is set
332-
commandContext.projectSettingsProvider.projectEnv.firstLaunchedConfigured = true;
333340
} catch (error) {
334341
await handleValidationErrors(commandContext, error, async () => {
335342
return await checkWorkspace(commandContext, ignoreFocusOut);

src/extension.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
selectDevice,
2323
selectProjectFile,
2424
selectTarget,
25+
updatePackageDependencies,
2526
} from "./commands";
2627
import { BuildTaskProvider, executeTask } from "./BuildTaskProvider";
2728
import { DebugConfigurationProvider } from "./Debug/DebugConfigurationProvider";
@@ -418,6 +419,14 @@ export async function activate(context: vscode.ExtensionContext) {
418419
}
419420
})
420421
);
422+
423+
context.subscriptions.push(
424+
vscode.commands.registerCommand("vscode-ios.run.project.update.deps", async () => {
425+
atomicCommand.userCommand(async context => {
426+
await updatePackageDependencies(context);
427+
}, "Update Package Dependencies");
428+
})
429+
);
421430
}
422431

423432
// This method is called when your extension is deactivated

src/nonActiveExtension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,10 @@ export function activateNotActiveExtension(context: vscode.ExtensionContext) {
138138
showErrorOnPerformingExtensionCommand
139139
)
140140
);
141+
context.subscriptions.push(
142+
vscode.commands.registerCommand(
143+
"vscode-ios.run.project.update.deps",
144+
showErrorOnPerformingExtensionCommand
145+
)
146+
);
141147
}

0 commit comments

Comments
 (0)