Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async run(): Promise {
const conn = this.org.getConnection();
conn.version = '45.0';
/*
* 1. DEVELOPER EXPERIENCE
*/
const project = await SfdxProject.resolve();
const projectJson = await project.resolveProjectConfig();
const packageAliases = new Array(projectJson.packageAliases);
for (var application of packageAliases) {
// retrieve the version ids from the sfdx-project.json
// TODO: There my be versions not registered in sfdx-project.json
// that should be added here
for (var key in Object(application)) {
let packageVersion: string = application[key];
if (packageVersion.startsWith('04t')) {
// this.subscriberPackage.push(packageVersion);
}
}
private static async initializeSfdxProjectConfig() {
if (
!SfdxProjectConfig.instance &&
isSfdxProjectOpened.apply(vscode.workspace).result
) {
const sfdxProjectPath = getRootWorkspacePath();
try {
const sfdxProject = await SfdxProject.resolve(sfdxProjectPath);
SfdxProjectConfig.instance = await sfdxProject.retrieveSfdxProjectJson();
const fileWatcher = vscode.workspace.createFileSystemWatcher(
path.join(sfdxProjectPath, SFDX_PROJECT_FILE)
);
fileWatcher.onDidChange(async () => {
try {
await SfdxProjectConfig.instance.read();
} catch (error) {
SfdxProjectConfig.handleError(error);
throw error;
}
});
} catch (error) {
SfdxProjectConfig.handleError(error);
throw error;
}