1
- import { mustCall , mustNotMutateObjectDeep } from '../common/index.mjs' ;
1
+ import { mustCall , mustNotMutateObjectDeep , isInsideDirWithUnusualChars } from '../common/index.mjs' ;
2
2
3
3
import assert from 'assert' ;
4
4
import fs from 'fs' ;
@@ -264,7 +264,7 @@ function nextdir(dirname) {
264
264
}
265
265
266
266
// It throws error if parent directory of symlink in dest points to src.
267
- {
267
+ if ( ! isInsideDirWithUnusualChars ) {
268
268
const src = nextdir ( ) ;
269
269
mkdirSync ( join ( src , 'a' ) , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
270
270
const dest = nextdir ( ) ;
@@ -279,7 +279,7 @@ function nextdir(dirname) {
279
279
}
280
280
281
281
// It throws error if attempt is made to copy directory to file.
282
- {
282
+ if ( ! isInsideDirWithUnusualChars ) {
283
283
const src = nextdir ( ) ;
284
284
mkdirSync ( src , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
285
285
const dest = './test/fixtures/copy/kitchen-sink/README.md' ;
@@ -310,7 +310,7 @@ function nextdir(dirname) {
310
310
311
311
312
312
// It throws error if attempt is made to copy file to directory.
313
- {
313
+ if ( ! isInsideDirWithUnusualChars ) {
314
314
const src = './test/fixtures/copy/kitchen-sink/README.md' ;
315
315
const dest = nextdir ( ) ;
316
316
mkdirSync ( dest , mustNotMutateObjectDeep ( { recursive : true } ) ) ;
@@ -346,7 +346,7 @@ function nextdir(dirname) {
346
346
347
347
// It throws error if attempt is made to copy src to dest
348
348
// when src is parent directory of the parent of dest
349
- {
349
+ if ( ! isInsideDirWithUnusualChars ) {
350
350
const src = nextdir ( 'a' ) ;
351
351
const destParent = nextdir ( 'a/b' ) ;
352
352
const dest = nextdir ( 'a/b/c' ) ;
@@ -370,7 +370,7 @@ function nextdir(dirname) {
370
370
}
371
371
372
372
// It throws an error if attempt is made to copy socket.
373
- if ( ! isWindows ) {
373
+ if ( ! isWindows && ! isInsideDirWithUnusualChars ) {
374
374
const src = nextdir ( ) ;
375
375
mkdirSync ( src ) ;
376
376
const dest = nextdir ( ) ;
@@ -738,7 +738,7 @@ if (!isWindows) {
738
738
}
739
739
740
740
// It returns an error if attempt is made to copy socket.
741
- if ( ! isWindows ) {
741
+ if ( ! isWindows && ! isInsideDirWithUnusualChars ) {
742
742
const src = nextdir ( ) ;
743
743
mkdirSync ( src ) ;
744
744
const dest = nextdir ( ) ;
0 commit comments