Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Dec 24, 2024
1 parent 3f6bc32 commit 33b4537
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/managers/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ if (

// Taken from https://github.com/isaacs/node-tar/blob/main/src/strip-absolute-path.ts
export const stripAbsolutePath = (path) => {
// This appears to be a most frequent case, so let's return quickly.
if (path === "/") {
return "";
}
let parsed = win32.parse(path);
while (win32.isAbsolute(path) || parsed.root) {
// windows will think that //x/y/z has a "root" of //x/y/
Expand Down Expand Up @@ -762,6 +766,8 @@ export const getImage = async (fullImageName) => {
/**
* Warnings such as TAR_ENTRY_INFO are treated as errors in strict mode. While this is mostly desired, we can relax this
* requirement for one particular warning related to absolute paths.
* This callback function checks for absolute paths in the entry read from the archive and strips them using a custom
* method.
*
* @param entry {tar.ReadEntry} ReadEntry object from node-tar
*/
Expand Down
1 change: 1 addition & 0 deletions types/lib/managers/docker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export function detectRancherDesktop(): any;
export const isWin: boolean;
export const DOCKER_HUB_REGISTRY: "docker.io";
export function stripAbsolutePath(path: any): any;
export function getDirs(dirPath: string, dirName: string, hidden?: boolean, recurse?: boolean): string[];
export function getOnlyDirs(srcpath: any, dirName: any): any;
export function getConnection(options: any, forRegistry: any): Promise<any>;
Expand Down
2 changes: 1 addition & 1 deletion types/lib/managers/docker.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33b4537

Please sign in to comment.