Skip to content

Commit

Permalink
prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrige committed Aug 11, 2023
1 parent 6a489dd commit 56eca52
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ export async function get({
// Remove compressed file after download and decompress.
return request.then(async () => {
if (ffmpeg === true) {
let ffmpegFile
let ffmpegFile;
if (platform === "linux") {
ffmpegFile = 'libffmpeg.so'
ffmpegFile = "libffmpeg.so";
} else if (platform === "win") {
ffmpegFile = 'ffmpeg.dll'
ffmpegFile = "ffmpeg.dll";
} else if (platform === "osx") {
ffmpegFile = 'libffmpeg.dylib'
ffmpegFile = "libffmpeg.dylib";
}
await replaceFfmpeg(platform, nwDir, ffmpegFile);
}
Expand Down
24 changes: 12 additions & 12 deletions src/util/ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ import { resolve } from "node:path";
* @param {string} ffmpegFile The path to the ffmpeg file to replace with
*/
export const replaceFfmpeg = async (platform, nwDir, ffmpegFile) => {
const src = resolve(nwDir, ffmpegFile)
const src = resolve(nwDir, ffmpegFile);
if (platform === "linux") {
const dest = resolve(nwDir, "lib", ffmpegFile)
const dest = resolve(nwDir, "lib", ffmpegFile);
await copyFile(src, dest);
} else if (platform === "win") {
// don't do anything for windows because the extracted file is already in the correct path
// await copyFile(src, resolve(nwDir, ffmpegFile));
} else if (platform === "osx") {
const dest = resolve(
nwDir,
"nwjs.app",
"Contents",
"Frameworks",
"nwjs Framework.framework",
"Versions",
"Current",
ffmpegFile
);
nwDir,
"nwjs.app",
"Contents",
"Frameworks",
"nwjs Framework.framework",
"Versions",
"Current",
ffmpegFile,
);

await copyFile(src, dest);
await copyFile(src, dest);
}
};

0 comments on commit 56eca52

Please sign in to comment.