Skip to content

Commit

Permalink
Fix symlink support
Browse files Browse the repository at this point in the history
  • Loading branch information
sjchmiela committed Feb 4, 2025
1 parent 1b78407 commit f2d30d4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/eas-cli/src/vcs/local.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fg from 'fast-glob';
import fs from 'fs-extra';
import fs from 'fs/promises';
import fsExtra from 'fs-extra';
import createIgnore, { Ignore as SingleFileIgnore } from 'ignore';
import path from 'path';

Expand Down Expand Up @@ -36,10 +37,10 @@ export class Ignore {

public async initIgnoreAsync(): Promise<void> {
const easIgnorePath = path.join(this.rootDir, EASIGNORE_FILENAME);
if (await fs.pathExists(easIgnorePath)) {
if (await fsExtra.pathExists(easIgnorePath)) {
this.ignoreMapping = [
['', createIgnore().add(DEFAULT_IGNORE)],
['', createIgnore().add(await fs.readFile(easIgnorePath, 'utf-8'))],
['', createIgnore().add(await fsExtra.readFile(easIgnorePath, 'utf-8'))],
];
return;
}
Expand All @@ -57,7 +58,7 @@ export class Ignore {
ignoreFilePaths.map(async filePath => {
return [
filePath.slice(0, filePath.length - GITIGNORE_FILENAME.length),
createIgnore().add(await fs.readFile(path.join(this.rootDir, filePath), 'utf-8')),
createIgnore().add(await fsExtra.readFile(path.join(this.rootDir, filePath), 'utf-8')),
] as const;
})
);
Expand All @@ -77,7 +78,10 @@ export class Ignore {
export async function makeShallowCopyAsync(src: string, dst: string): Promise<void> {
const ignore = new Ignore(src);
await ignore.initIgnoreAsync();
await fs.copy(src, dst, {
await fs.cp(src, dst, {
recursive: true,
// Preserve symlinks without re-resolving them to their original targets
verbatimSymlinks: true,
filter: (srcFilePath: string) => {
if (srcFilePath === src) {
return true;
Expand Down

0 comments on commit f2d30d4

Please sign in to comment.