Pipe through --updater/--no-updater flag for flipper.exe (#4277)
Summary: In our organization, Flipper is distributed in a version controlled way. As a result, we do not want users to manually update or receive prompts to update when a new version is available. There is already a `--updater` flag in the command line arguments for flipper.exe, but it isn't piped through. This change pipes it through and disables all update related UI when `--no-updater` is passed in. ## Changelog Support --updater and --no-updater options for flipper.exe Pull Request resolved: https://github.com/facebook/flipper/pull/4277 Test Plan: Ran `yarn build --win` in flipper/desktop, and launched flipper.exe from flipper/dist/win-unpacked with the `--updater`, `--no-updater` and no flags and ensured the proper behavior was observed (update UI shows by default or when `--updater` is specified, and doesn't show when `--no-updater` is specified). Reviewed By: passy Differential Revision: D41298321 Pulled By: mweststrate fbshipit-source-id: 5ddfede2700954f0fdd6a111b20d0836fab25565
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f70b2a2d1e
commit
7a28ed1fe5
@@ -77,7 +77,7 @@ export type LauncherSettings = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Settings that primarily only apply to Electron atm
|
// Settings that primarily only apply to Electron atm
|
||||||
// TODO: further separte between flipper-ui config and Electron config
|
// TODO: further separate between flipper-ui config and Electron config
|
||||||
export type ProcessConfig = {
|
export type ProcessConfig = {
|
||||||
disabledPlugins: string[];
|
disabledPlugins: string[];
|
||||||
lastWindowPosition: {
|
lastWindowPosition: {
|
||||||
@@ -90,6 +90,7 @@ export type ProcessConfig = {
|
|||||||
launcherMsg: string | null;
|
launcherMsg: string | null;
|
||||||
// Controls whether to delegate to the launcher if present.
|
// Controls whether to delegate to the launcher if present.
|
||||||
launcherEnabled: boolean;
|
launcherEnabled: boolean;
|
||||||
|
updaterEnabled: boolean;
|
||||||
// Control whether to suppress "update available" notifications
|
// Control whether to suppress "update available" notifications
|
||||||
suppressPluginUpdateNotifications?: boolean;
|
suppressPluginUpdateNotifications?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ test('config is decoded from env', () => {
|
|||||||
screenCapturePath: '/my/screenshot/path',
|
screenCapturePath: '/my/screenshot/path',
|
||||||
launcherEnabled: false,
|
launcherEnabled: false,
|
||||||
suppressPluginUpdateNotifications: true,
|
suppressPluginUpdateNotifications: true,
|
||||||
|
updaterEnabled: true,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@ test('config is decoded from env', () => {
|
|||||||
screenCapturePath: '/my/screenshot/path',
|
screenCapturePath: '/my/screenshot/path',
|
||||||
launcherEnabled: false,
|
launcherEnabled: false,
|
||||||
suppressPluginUpdateNotifications: true,
|
suppressPluginUpdateNotifications: true,
|
||||||
|
updaterEnabled: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -39,5 +41,6 @@ test('config is decoded from env with defaults', () => {
|
|||||||
screenCapturePath: undefined,
|
screenCapturePath: undefined,
|
||||||
launcherEnabled: true,
|
launcherEnabled: true,
|
||||||
suppressPluginUpdateNotifications: false,
|
suppressPluginUpdateNotifications: false,
|
||||||
|
updaterEnabled: true,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ export function loadProcessConfig(env: NodeJS.ProcessEnv): ProcessConfig {
|
|||||||
screenCapturePath: json.screenCapturePath,
|
screenCapturePath: json.screenCapturePath,
|
||||||
launcherEnabled:
|
launcherEnabled:
|
||||||
typeof json.launcherEnabled === 'boolean' ? json.launcherEnabled : true,
|
typeof json.launcherEnabled === 'boolean' ? json.launcherEnabled : true,
|
||||||
|
updaterEnabled:
|
||||||
|
typeof json.updaterEnabled === 'boolean' ? json.updaterEnabled : true,
|
||||||
suppressPluginUpdateNotifications:
|
suppressPluginUpdateNotifications:
|
||||||
typeof json.suppressPluginUpdateNotifications === 'boolean'
|
typeof json.suppressPluginUpdateNotifications === 'boolean'
|
||||||
? json.suppressPluginUpdateNotifications
|
? json.suppressPluginUpdateNotifications
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export default function UpdateIndicator() {
|
|||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
version &&
|
version &&
|
||||||
|
config.updaterEnabled &&
|
||||||
!config.suppressPluginUpdateNotifications &&
|
!config.suppressPluginUpdateNotifications &&
|
||||||
isProduction()
|
isProduction()
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -284,7 +284,12 @@ async function waitForLogin(store: Store) {
|
|||||||
|
|
||||||
async function verifyFlipperIsUpToDate(title: string) {
|
async function verifyFlipperIsUpToDate(title: string) {
|
||||||
const config = getRenderHostInstance().serverConfig.processConfig;
|
const config = getRenderHostInstance().serverConfig.processConfig;
|
||||||
if (!isProduction() || isTest() || config.suppressPluginUpdateNotifications) {
|
if (
|
||||||
|
!isProduction() ||
|
||||||
|
isTest() ||
|
||||||
|
!config.updaterEnabled ||
|
||||||
|
config.suppressPluginUpdateNotifications
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const currentVersion = getAppVersion();
|
const currentVersion = getAppVersion();
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ function createStubRenderHost(): RenderHost {
|
|||||||
launcherEnabled: false,
|
launcherEnabled: false,
|
||||||
launcherMsg: null,
|
launcherMsg: null,
|
||||||
screenCapturePath: `/dev/null`,
|
screenCapturePath: `/dev/null`,
|
||||||
|
updaterEnabled: true,
|
||||||
suppressPluginUpdateNotifications: false,
|
suppressPluginUpdateNotifications: false,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
Reference in New Issue
Block a user