1- 'use strict '
1+ import path from 'path '
22
3- const path = require ( 'path' )
3+ import exec from '../exec.js'
4+ import {
5+ checkAccess ,
6+ chmod ,
7+ copyFile as copyFileShared ,
8+ makeSymlink as makeSymlinkShared
9+ } from './shared.js'
410
5- const exec = require ( '../exec' )
6- const { checkAccess, chmod, copyFile, makeSymlink } = require ( './shared' )
11+ const makeDirRecursive = ( { target } ) => exec ( `mkdir -p ${ target } ` )
712
813const unlink = ( { target } ) => exec ( `rm -rf ${ target } ` )
914
10- const makeDirRecursive = ( { target } ) => exec ( `mkdir -p ${ target } ` )
11-
1215const chmodRecursive = ( { fmode, dmode, target } ) =>
1316 Promise . all ( [
1417 exec ( `find ${ target } -type f -exec chmod ${ fmode . toString ( 8 ) } {} +` ) ,
@@ -30,18 +33,18 @@ const overwriteDirectory = async ({ source, destination }) => {
3033 return exec ( `rsync -rtc --del --links ${ source } / ${ destination } ` )
3134}
3235
33- const copyFileLiunx = async ( { source, destination } ) => {
36+ const copyFile = async ( { source, destination } ) => {
3437 await makeDirRecursive ( { target : path . dirname ( destination ) } )
35- return copyFile ( { source, destination } )
38+ return copyFileShared ( { source, destination } )
3639}
3740
38- const makeSymlinkLinux = async ( { source, destination } ) => {
41+ const makeSymlink = async ( { source, destination } ) => {
3942 await makeDirRecursive ( { target : path . dirname ( source ) } )
4043 await unlink ( { target : source } )
41- return makeSymlink ( { source, destination } )
44+ return makeSymlinkShared ( { source, destination } )
4245}
4346
44- module . exports = {
47+ export default {
4548 checkAccess,
4649 unlink,
4750 chmod,
@@ -51,6 +54,6 @@ module.exports = {
5154 chgrp,
5255 chgrpRecursive,
5356 overwriteDirectory,
54- copyFile : copyFileLiunx ,
55- makeSymlink : makeSymlinkLinux
57+ copyFile,
58+ makeSymlink
5659}
0 commit comments