diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-26 22:27:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-26 22:27:35 +0000 |
commit | 2456710acb7b4369eabd67ab4b31297ae142bb6a (patch) | |
tree | 66c53381f19ebc027fba14323ad9195555ee2858 /Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml | |
parent | 3465548e0c1d39b187bc8b5427001d0c9c5d1e4f (diff) |
arara (26feb21)
git-svn-id: svn://tug.org/texlive/trunk@57953 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml')
-rw-r--r-- | Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml b/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml new file mode 100644 index 00000000000..d11365ada0b --- /dev/null +++ b/Master/texmf-dist/scripts/arara/rules/arara-rule-move.yaml @@ -0,0 +1,39 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2020, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: move +name: Move +authors: +- Island of TeX +commands: +- name: The OS move call + command: > + @{ + prefix = []; + if (isUnix()) { + prefix = [ 'mv', '-f' ]; + } + else { + prefix = [ 'cmd', '/c', 'move', '/Y' ]; + } + if (getOriginalReference() == reference) { + throwError('I cannot move the main file reference.'); + } + 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 + |