feat: dynamic pp calculator switching#635
Open
storycraft wants to merge 47 commits into
Open
Conversation
cyperdark
requested changes
Jun 24, 2026
Comment on lines
+34
to
+38
| await tar.x({ | ||
| file: archivePath, | ||
| cwd: folderPath, | ||
| strip: 1 | ||
| }); |
Collaborator
There was a problem hiding this comment.
yesterday i had to unpack .tar.gz & .tgz, for that i used system tar with calling execFile, and as far as i know it's installed by default on windows and linux
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
import path from 'path';
async function extractTar(file_path: string, destination: string, args: string[]): Promise<string | Error> {
try {
const tgz_path = path.resolve(file_path);
const dest_path = path.resolve(destination);
const result = await promisify(execFile)('tar', ['-xzf', `${tgz_path}`, '-C', `${dest_path}`, ...args]);
if (result.stderr) return new Error(result.stderr);
return result.stdout;
} catch (error: any) {
return error.code === 'ENOENT'
? new Error('The "tar" command is not found in your system PATH. Please ensure it is installed.')
: error;
};
};example of usage:
const extract = await extractTar(file_path, cache_directory, ['--strip-components=2']);
if (extract.status == 'error') {
console.error(`extracting failed`, extract);
process.exit(1);
};
Member
Author
There was a problem hiding this comment.
No idea if it's good idea to rely on os command
cyperdark
reviewed
Jun 24, 2026
* replace ugly npm library to manual types.
* replace ugly npm library to manual types.
storycraft
force-pushed
the
feat/pp-switcher
branch
from
June 26, 2026 13:50
154fb0f to
7a0a27a
Compare
…to feat/pp-switcher
storycraft
marked this pull request as ready for review
June 26, 2026 19:02
cyperdark
reviewed
Jun 27, 2026
GabuTheDev
reviewed
Jul 2, 2026
| case 'dist-tag': { | ||
| wLogger.info( | ||
| '[calculator]', | ||
| `Using dist-tag "${module.tag}" calculator` |
Member
There was a problem hiding this comment.
These log messages really do not tell anything for the end user.
Either make them end user friendly, or move them to debug.
* switch to prebuilt
* More user friendly messages
…to feat/pp-switcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Todo