Follow symbolic links

This commit is contained in:
Naïm Favier 2021-11-24 02:29:56 +01:00
parent 17cd0d34de
commit 9c9d8019fa
No known key found for this signature in database
GPG key ID: 49B07322580B7EE2
3 changed files with 6 additions and 6 deletions

View file

@ -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;
@ -74,7 +74,7 @@ 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())
);
}, []);
};
@ -82,7 +82,7 @@ export const paths = (patterns: string[]): string[] => {
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]
: []
);