diff options
Diffstat (limited to 'Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml')
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml new file mode 100644 index 00000000000..b43ef1e28ac --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-copy.yaml @@ -0,0 +1,36 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: copy +name: Copy +authors: +- Island of TeX +commands: +- name: The OS copy call + command: > + @{ + prefix = []; + if (isUnix()) { + prefix = [ 'cp', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'copy', '/Y' ]; + } + t = isList(target) ? target[0] : target; + f = toFile(t).getCanonicalFile(); + if (getOriginalReference().equals(f)) { + throwError('I cannot overwrite the main file reference.'); + } + return getCommand(prefix, reference, t); + } +arguments: +- identifier: target + flag: > + @{ + return parameters.target; + } + required: true + |