Skip to content

Commit

Permalink
move platforms to devscripts; finish winget script
Browse files Browse the repository at this point in the history
  • Loading branch information
sylviiu committed Nov 20, 2023
1 parent 5964994 commit e1b6e8f
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 147 deletions.
26 changes: 18 additions & 8 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,10 @@ const getFullMetadata = () => new Promise(async res => {
const obj = {
commitHash: `unk`,
fullCommitHash: `unknown`,
owner: [`sylviiu`, `ezytdl`],
branch: null,
buildNumber: buildArgs.buildNumber || -1,
buildInfo: {
"ezytdl": {
"Version": pkg.version,
"Commit Hash": pkg.fullCommitHash || `unknown`,
"Built": pkg.buildDate || global.startTime,
},
"Electron": {
"Version": pkg.devDependencies.electron.replace(`^`, ``),
"Built with": `electron-builder ` + pkg.devDependencies['electron-builder'].replace(`^`, ``),
Expand Down Expand Up @@ -153,15 +149,29 @@ const getFullMetadata = () => new Promise(async res => {
res();
});
}),
new Promise(async res => {
// owner
child_process.execFile(git, [`remote`, `get-url`, `origin`], (err, stdout, stderr) => {
if(err) return res();
if(stdout && stdout.toString && stdout.toString()) toAppend.owner = stdout.toString().trim().split(`/`).filter(Boolean).slice(-2);
res();
});
}),
])

Object.assign(obj, {
commitHash: child_process.execFileSync(git, [`rev-parse`, `--short`, `HEAD`]).toString().trim(),
})
Object.assign(obj, toAppend);
}

Object.assign(config.extraMetadata, obj);

Object.assign(config.extraMetadata.buildInfo, {
"ezytdl": {
"Version": pkg.version,
"Commit": obj.fullCommitHash || `unknown`,
"Built": obj.buildDate || global.startTime,
},
});

fullMetadataDone = true;

console.log(`extra metadata`, config.extraMetadata)
Expand Down
15 changes: 0 additions & 15 deletions build/scripts/platform.js

This file was deleted.

102 changes: 0 additions & 102 deletions build/scripts/platforms/win32/winget.js

This file was deleted.

Loading

0 comments on commit e1b6e8f

Please sign in to comment.