Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete file extension doubling #628

Merged
merged 9 commits into from
Nov 9, 2023
Merged

delete file extension doubling #628

merged 9 commits into from
Nov 9, 2023

Conversation

sydb
Copy link
Member

@sydb sydb commented Sep 29, 2023

Per #543, strip off the input file’s extension (if it is one of the extensions we know about, that is) before appending the output file extension.

Code seems to work, but some serious testing is in order. Reviewers should test the code by trying several cases of things like the following, in with no output specified, with an output filename specified that is in the same dir as input, in current dir, or in a different dir altogether.

  • Input file in current directory, filetype matches command name
  • Input file in different directory, filetype matches command name
  • Input file in current directory, filetype a normal one
  • Input file in different directory, filetype a normal one
  • Input file in current directory, filetype a weird one (or none)
  • Input file in different directory, filetype a weird one (or none)

E.g., cd ~ ; /path/to/Stylesheets/bin/csvtotei ~/rockyracoon.coseva /tmp/rockyracoon.tei would be an example of the last with output in a different directory altogether.

@sydb sydb added resp: council conversion Having to do with the shell scripts and ant tasks that perform the various conversions. labels Sep 29, 2023
@sydb sydb added this to the Release 7.56.0 milestone Sep 29, 2023
@sydb sydb marked this pull request as draft September 30, 2023 02:06
@sydb
Copy link
Member Author

sydb commented Sep 30, 2023

Note — not passing tests yet. (I forgot all about them.) Reviewers should feel free to test now or wait until tests are passing.

@sydb
Copy link
Member Author

sydb commented Sep 30, 2023

Craziness — I just discovered that running cd Stylesheets/ ; make test does run the clean: target in the Test/Makefile, but running cd Stylesheets/Test/ ; make does not.

In any case, I think I finally have the tests working. If anyone is interested, here is how you can rename every file named “A.xml.B.ext” to just “A.B.ext”:

$ for f in *.xml.*; do echo "---------$f:" ; git mv $f ${f%.xml.*}.${f##*.xml.} ; done

@sydb sydb marked this pull request as ready for review October 9, 2023 22:40
@sydb sydb requested review from raffazizzi and removed request for peterstadler November 9, 2023 20:10
@raffazizzi raffazizzi merged commit 6639c26 into dev Nov 9, 2023
4 checks passed
sydb added a commit that referenced this pull request Nov 9, 2023
@peterstadler peterstadler deleted the sydb_543_file_exts branch November 11, 2023 00:59
@raffazizzi raffazizzi added this to the Release 7.56.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversion Having to do with the shell scripts and ant tasks that perform the various conversions. resp: council
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants