Skip to content

Commit

Permalink
🔨 Add configurable update feed from webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
NovusTheory committed Jan 28, 2024
1 parent 30a2493 commit da82909
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ declare const SETTINGS_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
declare const YTM_VIEW_PRELOAD_WEBPACK_ENTRY: string;

declare const YTMD_DISABLE_UPDATES: boolean;
declare const YTMD_UPDATE_FEED_OWNER: string;
declare const YTMD_UPDATE_FEED_REPOSITORY: string;

const assetFolder = path.join(process.env.NODE_ENV === "development" ? path.join(app.getAppPath(), "src/assets") : process.resourcesPath);

Expand Down Expand Up @@ -238,7 +240,7 @@ function shouldDisableUpdates() {
// macOS cannot use the autoUpdater without a code signature at this time
if (app.isPackaged && !shouldDisableUpdates() && !YTMD_DISABLE_UPDATES) {
const updateServer = "https://update.electronjs.org";
const updateFeed = `${updateServer}/ytmdesktop/ytmdesktop/${process.platform}-${process.arch}/${app.getVersion()}`;
const updateFeed = `${updateServer}/${YTMD_UPDATE_FEED_OWNER}/${YTMD_UPDATE_FEED_REPOSITORY}/${process.platform}-${process.arch}/${app.getVersion()}`;

autoUpdater.setFeedURL({
url: updateFeed
Expand Down
4 changes: 3 additions & 1 deletion webpack.main.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const mainConfig: Configuration = {
},
plugins: [
new DefinePlugin({
YTMD_DISABLE_UPDATES: false
YTMD_DISABLE_UPDATES: false,
YTMD_UPDATE_FEED_OWNER: "ytmdesktop",
YTMD_UPDATE_FEED_REPOSITORY: "ytmdesktop"
})
],
resolve: {
Expand Down

0 comments on commit da82909

Please sign in to comment.