Skip to content

Commit

Permalink
fix bdistin#515: use resolved path for moving file (fix underlying pr…
Browse files Browse the repository at this point in the history
…oblem that source directory is not a full path that might cause a cross-device link error)
  • Loading branch information
stanleyxu2005 committed Jan 18, 2021
1 parent 928bb20 commit e1848d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nextra/move.ts
Expand Up @@ -25,7 +25,9 @@ export interface MoveOptions {
*/
export async function move(source: string, destination: string, options: MoveOptions = {}): Promise<void> {
const overwrite = options.overwrite || false;
if (resolve(source) === resolve(destination)) return fsp.access(source);
source = resolve(source)
destination = resolve(destination)
if (source === destination) return fsp.access(source);

const myStat = await fsp.lstat(source);
if (myStat.isDirectory() && isSrcKid(source, destination)) {
Expand Down

0 comments on commit e1848d2

Please sign in to comment.