Skip to content

Commit

Permalink
fix: πŸ› symlink detection
Browse files Browse the repository at this point in the history
issue with symlink, should impact to bug with github superliner

βœ… Closes: #542,#520
  • Loading branch information
kucherenko committed Oct 1, 2022
1 parent e90f409 commit f514336
Show file tree
Hide file tree
Showing 3 changed files with 4,410 additions and 4,646 deletions.
10 changes: 6 additions & 4 deletions packages/finder/src/files.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {getOption, IOptions} from '@jscpd/core';
import {Entry, sync} from 'fast-glob';
import {getFormatByFile} from '@jscpd/tokenizer';
import {readFileSync} from 'fs-extra';
import { readFileSync, realpathSync } from 'fs-extra';
import {grey} from 'colors/safe';
import {EntryWithContent} from './interfaces';
import {lstatSync, Stats} from "fs";
Expand Down Expand Up @@ -81,11 +81,13 @@ export function getFilesToDetect(options: IOptions): EntryWithContent[] {
}

patterns = patterns.map((path: string) => {
if (isFile(path)) {
return path;
const currentPath = realpathSync(path);
if (isFile(currentPath)) {
return currentPath;
}
return path.substr(path.length - 1) === '/' ? `${path}${pattern}` : `${path}/${pattern}`;
return currentPath.substr(path.length - 1) === '/' ? `${currentPath}${pattern}` : `${currentPath}/${pattern}`;
});

return sync(
patterns,
{
Expand Down
24 changes: 12 additions & 12 deletions packages/html-reporter/mockups/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
"@fortawesome/fontawesome-free": "^5.14.0",
"core-js": "^3.6.5",
"tailwindcss": "1.9.6",
"vue": "^2.6.11",
"vue": "^2.7.10",
"vue-class-component": "^7.2.3",
"vue-prism-component": "^1.2.0",
"vue-property-decorator": "^8.4.2",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^2.3.0",
"@vue/cli-plugin-pwa": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"autoprefixer": "^9.8.6",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"typescript": "~3.9.3",
"vue-template-compiler": "^2.6.11"
"@fullhuman/postcss-purgecss": "^5.0.0",
"@vue/cli-plugin-pwa": "^5.0.8",
"@vue/cli-plugin-router": "^5.0.8",
"@vue/cli-plugin-typescript": "^5.0.8",
"@vue/cli-plugin-vuex": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"autoprefixer": "^10.4.12",
"node-sass": "^7.0.3",
"sass-loader": "^13.0.2",
"typescript": "^4.8.4",
"vue-template-compiler": "^2.7.10"
},
"browserslist": [
"> 1%",
Expand Down
Loading

0 comments on commit f514336

Please sign in to comment.