I would like to clone an existing file structure, without copying the files, during a grunt task. The new structure should be empty in the beginning and will be filled with processed data from the already existing file structure.
I've checked grunt-contrib-copy but there seems to be no filter for copying directories only.
This is true, place a .keep file in each (or lowest-level) directory and run grunt-contrib-copy and it will replicate your structure.
Updating this to cover the comments:
There is currently no option in grunt-contrib-copy or grunt-init to copy the structure only.
If however, you put aside the option of starting from 0, you could simply allow the pre-processed data to fill the structure, and pass a newer: to your copy task to only overwrite files that are older than those present.
If you absolutely need those folders to be empty, your best bet is to set up a boilerplate for yourself. I wish I could stumble on something better for this.
Related
Using R, when copying files from one folder to another, we can use the function file.copy and in order to not copy existing files, we can use the argument overwrite = FALSE.
I thought that it is very fast when files already exist, for me, we can just check if a file with the same name exists, if it is the case, then we do not copy. But in practice I see that it is not the case. So I am wondering what really happens when overwrite = FALSE.
And is there a simple solution to make the process of detecting existing files (and thus not copying) faster?
I've written an Extension that, among many other things, renames files based on the Types they contain.
This works fine for files in the directory-tree under the csproj-file -- I find the ProjectItem entry for the file and change its name.
For 'linked'-files (those not in the directory-tree) I can rename the file (via File.Move()) but haven't found a way to programatically modify the csproj-file (after the rename the csproj-file has to be modified manually).
If this is something that can be done I'd appreciate a pointer to the docs showing how to implement the functionality.
The easiest solution for me was to modify the csproj-file.
Open, read whole file, close.
Verify that file I want to rename (e.g. xxx.cs) only occurs in 1 directory
(if it occurs in multiple directories the change has to be done manually.)
Make change
Open, write whole file, close
For an SDK project the change is applied immediately.
For a non-SDK project the change is applied after responding to the prompt that the csproj-file has been modified.
Can I exclude a file pattern that includes its parent directories in atom? For example, I want to exclude folder1/folder2/*.py. Also I don't want to put this into .gitignore, because the git repository is shared with others and only I don't care about those files. Thanks!
There are several packages available that let you keep an .atomignore file for exactly that purpose, e.g. tree-ignore or atom-ignore packages.
If I have a ASP.Net solution named "MyApp", that includes a single project "MyApp", and I then want to change both of them to "MyNewApp" - How can I do it safely, namely:
Without (breaking and then) needing to edit manually configuration files (that's what happened when I changed the names manually, and managed to fix it using this answer).
Without (breaking and then) needing to edit the .sln file.
Without needing to change the projects path.
I mean, is/are there any menu/s in VS enabling that?
There is no SAFE way of doing it.
The best one is to use the find and replace for all the project files
with Entire Solution filter.
First do copy the exact files in another location
Open the solution in new location, Find existing name and replace with the new one.
Open the .sln file with notepad and edit the file.
Is there any method to extract zip files and maintain the same folder structure in the output folder.I am able to extract the zip file and its inner files but not able to extract folder from a zip file and thus fail to maintain folder structure also.
Yes.
There is an AS3 component that allows you to read and write data from zip files, and the demo also shows that it is possible to see the folder structure.
http://www.nochump.com/blog/?p=15
I have not used this component myself, but if I am correct in assuming that you are making an AIR application then this component may automatically generate folders, otherwise you can use the file system api to create the correct folders yourself.
Good Luck!
You may also want to check out fzip:
http://codeazur.com.br/lab/fzip/