mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
26 lines
687 B
JavaScript
26 lines
687 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const os = require('os');
|
|
const distDirName = 'dist';
|
|
const distPath = path.join(__dirname, distDirName);
|
|
|
|
const renameLatestYmlFile = () => {
|
|
if (os.platform() === 'darwin' && process.arch === 'arm64') {
|
|
const latestMacFilePath = path.join(distPath, 'latest-mac.yml');
|
|
const renamedMacFilePath = path.join(distPath, 'latest-mac-arm64.yml');
|
|
|
|
if (fs.existsSync(latestMacFilePath)) {
|
|
fs.renameSync(latestMacFilePath, renamedMacFilePath);
|
|
return [renamedMacFilePath];
|
|
} else {
|
|
throw new Error('latest-mac.yml not found!');
|
|
}
|
|
}
|
|
};
|
|
|
|
const mainHook = () => {
|
|
renameLatestYmlFile();
|
|
};
|
|
|
|
exports.default = mainHook;
|