Skip to content

A Javascript error occurred in the main process #9

Description

@hohnworld

case 'copy':
{
// 问题:新目录隐藏
try {
robocopy({
// Specifies the path to the source directory.
// source: path.join(usb.disk + ':/', 'JW7135'),
// source: path.join(usb.disk + ':', 'd'),
// source: usb.disk + ':\JW7135\Movie', //会隐藏文件、文件夹 ,不能兼容不是这个目录的视频文件
source: usb.disk + ':', //会隐藏文件、文件夹
// Specifies the destination path(s).
// destination: z:\\20240612\\${usb.cz + usb.name},
destination: usb.destPath,
// files: '.mp4',
files: ['
.mp4', '.jpg', '.wav'],
copy: {
// Copies subdirectories. Note that this option excludes empty directories. [/s]
subdirs: true, //子目录:非空的
moveFilesAndDirs: true, //移动:复制完删除源
// removeAttributes: 'RASHCNET'
removeAttributes: 'SH'
},
retry: {
count: 0 //不重试:失败的时候
},
file: {
excludeDirs: ['System Volume Information', '$RECYCLE.BIN'],
excludeFiles: [
'未结束拷贝.日志',
'Time synchro(Pls Double Click Me).bat',
'Param.ini',
'BWC4G.ini'
]
}
})
.done(function () {
const delPath = path.join(usb.disk + ':', '未结束拷贝.日志')
exec(del ${delPath}, () => {
exec(attrib -s -h ${usb.destPath}, () => {
usb.progress = 1 //完成或报错
//移除:
// removeUsb(usb)
postTrackProgress(usb)
})
})
})
.fail(function (error) {
console.log(error.message)
console.log('移动失败:' + error)
})
} catch (e) {
console.log('移动异常:' + e)
}

Image

  }
  break

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions