pcdshub / pytmc

Generate EPICS IOCs and records from TwinCAT projects - along with many TwinCAT project tools
https://pcdshub.github.io/pytmc/
Other
10 stars 11 forks source link

`pytmc template` filename usage awkward on Windows #299

Closed klauer closed 1 year ago

klauer commented 1 year ago

os.pathsep is currently used to delimit the input file and the output file:

https://github.com/pcdshub/pytmc/blob/20d35b3c6328ae1e5ced222b82f05f79dd3ee4ee/pytmc/bin/template.py#L714

This is : on Linux and ; on Windows. Our ads-ioc Makefile only uses : (https://github.com/pcdshub/ads-ioc/blob/fc8a48a586751be00ba62b79c3a6cac7aface529/iocBoot/templates/Makefile.base#L101)

This is used with ads-deploy in Visual Studio, resulting in something like:

    --template "c:/Repos/ads-ioc/R0.6.0//iocBoot/templates/st.cmd.template":"st.cmd" \

My thought as to a fix:

I think we should standardize on : for all platforms. On Windows, we can iteratively check for the longest match that is an existing file. The remainder is the output. It'll be easier for us and users in the end... probably?

For now, this is patched locally/temporarily on plcprog-console