Skip to content

Commit

Permalink
fix(package): correct last build state for android (#52)
Browse files Browse the repository at this point in the history
Object.assign is not a deep copy like I thought, just null the passwords out manually on buildInfo
before storing

Fixed #47
  • Loading branch information
ewanharris authored and longton95 committed Mar 6, 2019
1 parent 7c42cad commit 26357e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/commands/packageApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { nameForPlatform, packageArguments, } from '../utils';
import { checkLogin, handleInteractionError, InteractionError } from './common';

import { enterAndroidKeystoreInfo, enterPassword, selectDistributionTarget, selectiOSCodeSigning, selectPlatform } from '../quickpicks/common';
import { KeystoreInfo } from '../types/common';

export async function packageApplication (node: DeviceNode | OSVerNode | PlatformNode | TargetNode) {
try {
Expand All @@ -19,11 +20,11 @@ export async function packageApplication (node: DeviceNode | OSVerNode | Platfor
const logLevel = ExtensionContainer.config.general.logLevel;

let iOSCertificate;
let iOSProvisioningProfile;
let keystoreInfo: KeystoreInfo;
let lastBuildDescription;
let outputDirectory;
let keystoreInfo;
let platform;
let iOSProvisioningProfile;
let target;

if (node) {
Expand Down Expand Up @@ -94,10 +95,11 @@ export async function packageApplication (node: DeviceNode | OSVerNode | Platfor
iOSProvisioningProfile,
logLevel
};
const storableInfo = Object.assign({}, buildInfo, { keystoreInfo: { password: null }});
ExtensionContainer.context.workspaceState.update(WorkspaceState.LastPackageState, storableInfo);
const args = packageArguments(buildInfo);
ExtensionContainer.terminal.runCommand(args);
buildInfo.keystoreInfo.password = null;
buildInfo.keystoreInfo.privateKeyPassword = null;
ExtensionContainer.context.workspaceState.update(WorkspaceState.LastPackageState, buildInfo);
} catch (error) {
if (error instanceof InteractionError) {
await handleInteractionError(error);
Expand Down
4 changes: 2 additions & 2 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface RunOptions {

export interface KeystoreInfo {
alias: string;
path: string;
location: string;
password: string;
privateKeyPassword?: string;
}
Expand All @@ -37,7 +37,7 @@ export interface ProvisioningProfile {
expirationDate: string;
file: string;
getTaskAllow: boolean;
managaged: boolean;
managed: boolean;
name: string;
team: string[];
uuid: string;
Expand Down

0 comments on commit 26357e0

Please sign in to comment.