Skip to content

Commit

Permalink
Follow symbolic links (softprops#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncfavier authored Nov 24, 2021
1 parent 17cd0d3 commit b260a9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/github.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from "node-fetch";
import { GitHub } from "@actions/github/lib/utils";
import { Config, isTag, releaseBody } from "./util";
import { lstatSync, readFileSync } from "fs";
import { statSync, readFileSync } from "fs";
import { getType } from "mime";
import { basename } from "path";

Expand Down Expand Up @@ -127,7 +127,7 @@ export const asset = (path: string): ReleaseAsset => {
return {
name: basename(path),
mime: mimeOrDefault(path),
size: lstatSync(path).size,
size: statSync(path).size,
data: readFileSync(path)
};
};
Expand Down
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as glob from "glob";
import { lstatSync, readFileSync } from "fs";
import { statSync, readFileSync } from "fs";

export interface Config {
github_token: string;
Expand Down Expand Up @@ -74,15 +74,15 @@ export const parseConfig = (env: Env): Config => {
export const paths = (patterns: string[]): string[] => {
return patterns.reduce((acc: string[], pattern: string): string[] => {
return acc.concat(
glob.sync(pattern).filter(path => lstatSync(path).isFile())
glob.sync(pattern).filter(path => statSync(path).isFile())
);
}, []);
};

export const unmatchedPatterns = (patterns: string[]): string[] => {
return patterns.reduce((acc: string[], pattern: string): string[] => {
return acc.concat(
glob.sync(pattern).filter(path => lstatSync(path).isFile()).length == 0
glob.sync(pattern).filter(path => statSync(path).isFile()).length == 0
? [pattern]
: []
);
Expand Down

0 comments on commit b260a9f

Please sign in to comment.