Skip to content

Commit

Permalink
chore(get): refactor implementation (#1025)
Browse files Browse the repository at this point in the history
### Description of Changes

- Use internal APIs such as request, decompress, ffmpeg, node and nw
functions.
  • Loading branch information
ayushmanchhabra authored Feb 3, 2024
1 parent 63fd50b commit 72f65e1
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 295 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ nwbuild({
- A commit's first line should be formatted as `<type>[optional scope]: <description>`.
- A commit's body should have a description of changes in bullet points followed by any links it references or issues it fixes or closes. It may include an optional `Notes: ...` section to provide additional context on why the PR is being merged when it doesn't seem like it should.
- Google's Release Please Action is used to update the changelog, bump the package version and generate GitHub releases.
- NPM Publish Action publishes to `npm` if there is a version bump.

## Roadmap

Expand All @@ -297,8 +298,9 @@ nwbuild({
### Chores

- chore(cli): migrate from `yargs` to `commander`
- chore(get): investigate [how symlinks are identified](https://github.com/overlookmotel/yauzl-promise/issues/39) and remove the workaround where they are created manually
- chore(get): verify sha checksum for downloads
- chore(util): factor out file paths as constant variables
- chore: annotate file paths as `fs.PathLike` instead of `string`.
- chore(bld): factor out core build step
- chore(bld): factor out linux config
- chore(bld): factor out macos config
Expand All @@ -307,6 +309,7 @@ nwbuild({
- chore(bld): factor out compressing
- chore(bld): factor out managed manifest
- chore(bld): move `.desktop` entry file logic to `create-desktop-shortcuts` package
- chore(util): factor out file paths as constant variables

## FAQ

Expand Down
232 changes: 0 additions & 232 deletions src/get.js

This file was deleted.

5 changes: 2 additions & 3 deletions src/get/decompress.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ export default async function decompress(filePath, cacheDir) {
* @param {string} cacheDir - directory to unzip in
* @return {Promise<void>}
*/
export async function unzip(zippedFile, cacheDir) {
async function unzip(zippedFile, cacheDir) {
await unzipInternal(zippedFile, cacheDir, false).then(() => {
unzipInternal(zippedFile, cacheDir, true);
})
}

/**
* Method for unzip with symlink in theoretical
* Method for unzip with symlink. Workaround for not being able to handle symlinks. Tracking in linked issue.
*
* @async
* @function
* @param unzipSymlink
* @param {string} zippedFile - file path to .zip file
* @param {string} cacheDir - directory to unzip in
* @param {boolean} unzipSymlink - Using or not symlink
Expand Down
Loading

0 comments on commit 72f65e1

Please sign in to comment.