How to delete files with `cookiecutter --replay`? - cookiecutter

If I modify my cookiecutter template and remove a file from the template, is it possible to get cookiecutter --replay to delete the removed file from projects when I replay the template over them?
I didn't see anything about this in the docs. I suppose I could write a post-generate hook to delete the file (each time you delete a file from the template, add it to the list of files that the post generate hook will delete from projects).
But I wonder if there's a way to get cookiecutter to do this for me?

Related

Errors when Trying to copy an existing screen and build it

In Acumatica v22R1, I'm trying to copy an existing screen (Business Accounts), give it a new screen ID and name, and modify it. After doing this, and changing the references in the .ASPX and code-behind to match the new screen ID, I add it to a customization project and try to publish it. The errors I get are related to an invalid path it's looking for in the .ASPX looking for *.inc files. For example:
<!--#include file="~\Pages\CR\Includes\ContactDetails.inc"-->
First thing I try is to just remove this line from the .ASPX. When I publish, Acumatica puts this line back in and it fails again. The error is looking for files in a different path --
C:\Program Files\Acumatica ERP\Customization\<instance>\<instance>Validation\<instance>Website\Pages\AK
This path is apparently generated during publishing. The "AK" on the end is the screen id prefix we use for custom screens. After the validation errors are thrown, I look in this location, and indeed the files it's looking for aren't there. I also tried to copy them there manually from the CR path, but of course they get wiped out automatically when Acumatica publishes and regenerates these folders.
Any ideas what I can do to resolve or get around these errors?
I was able to resolve this by copying all of the referenced *.inc files from the CR pages folder to my custom AK pages folder, then include them in the customization project. And also modify the .ASPX to change the path of these .inc files to my custom folder. The publish then leaves it alone and I can now build without error.

How to skip certain files when running `cookiecutter --replay`?

If I make a change to my cookiecutter template I like to use cookiecutter --replay (or --replay-file) to update my existing projects with the new template changes. When doing this, how can I skip certain files?
For example one thing my template contains is a requirements/ directory containing Python requirements files:
requirements/
main.in
main.txt
tests.in
tests.txt
It's useful for the template to output a starter set of requirements files when generating a new project. But the project will almost certainly modify these files whenever it adds or upgrades requirements so when replaying the template I would not want to overwrite the requirements files with the original starter ones. That would just delete any dependencies that've been added to the project since its inception.
I'm aware of --skip-if-file-exists but I don't want to skip all existing files, only the ones in the requirements/ dir.
The only solution that comes to mind immediately is to omit the requirements dir from the project template and use a post-generate hook to write out the starter requirements files only if they don't already exist.
But I wonder if there's a way to get cookiecutter to do this for me, without having to write it in Python myself?
For example is there some way to give cookiecutter --replay a list of files and directories to skip if they already exist?

How to auto Archive by version history

I want to put the files from Document library A into another document library called Archive. I have to version history enabled, limited to 10. when a new file gets added in, the older files get deleted. How can I move them to another document library called Archive. How can I achieve this? Please advise.
Using MS Flow you can build a simple workflow that will copy a file from one library to another one. The workflow can be triggered upon file add (list item) event. Everything can be done in MS Flow browser designer. When adding file to archive library you need to change its file name (e.g. add time stamp) so you will not overwrite existing file in archive library.

Installshield: file duplicate because of merge module

I have an InstallShield (2018, also happens in IS 11) setup with a lot of 3th party libraries. Among other things a merge module. This merge module have a file (call F).
Now, there is an other library as a directory with a bunch of different files, sadly also a file with the name "F".
I can't add this file:
A work around is creating a new merge module just containing this file and adding it to the feature. But the drawback is: When updating the libary directory, the merge module has also to be updated. But do I remember at this moment to this? What if other persons are doing this? So I want to avoid this work around. Is there a better way?
what worked for me is i removed merge module from the project and re-added them after adding files to the project.

Can you remove NetSuite Bundles after installation

I am working on a NetSuite instance that had custom(contractor/SuiteScript) work installed via a bundle, but it is not a third party product but made for this system. Now there are 2 listings in the dropdown for each file. In other words, if I am adding a file as a library, it shows up twice and I don't know which reference is the correct one to choose. I used search to find the duplicate file name is in the bundle install. Can I safely remove or delete the bundle? thanks any help is appreciated.
You cannot typically remove individual files from a bundle. If you do not need the functionality of the bundle anymore than you can remove it at your discretion by going to Customization>SuiteBundler>Search & Install Bundles>List, then under the action icon click 'Uninstall'.
I wouldn't try to delete a script library from a bundle folder. Even if you are uploading an identical library there may be references in the bundle scripts to the original library that will be broken when if you delete it.
If you are wondering which one you are selecting from the drop down one thing you could do is figure out the internal id of your library file then run a search on your script file that pulls in the library file id's and make sure that they match.

Resources