mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: buildFileCheckCmd
This commit is contained in:
1 parent
b7ecfe3980
commit
af27780763
3 files changed
+55
No files matched your search
@@ -0,0 +1,16 @@
|
||||
const fileTypes = {
|
||||
file: '-f',
|
||||
folder: '-d',
|
||||
link: '-L',
|
||||
socket: '-S',
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function buildFileCheckCmd(files) {
|
||||
return files
|
||||
.map(
|
||||
({ path, type, exists }) =>
|
||||
`${exists ? '' : '! '}test ${fileTypes[type] || '-e'} ${path}`
|
||||
)
|
||||
.join(' && ')
|
||||
}
|
||||
Reference in new issue
Block a user