Maintaining subfolder tree on move action?
See original GitHub issueCan’t seem to figure this one out.
Given a folder structure:
~/Downloads/SomeFontPackage/SomeFolder/font.ttf
I can’t figure out how to do a Move with a ttf
extension that will let me move to say:
~/Downloads/FONTS/SomeFontPackage/SomeFolder/font.ttf
(the goal being maintaining the folder structure)
I tried messing with the paths, including trying the {path.relative_to('~/Downloads)}
, following the PurePath documentation, but I get:
File lily_of_the_valley/Lily of the Valley.ttf:
- [Move] ERROR! Missing template variable 'PosixPath' object has no attribute 'relative_to('/Users/MYUSER/Downloads')' for "~/Downloads/FONTS/{path.relative_to('/Users/MYUSER/Downloads')}/"
I know you can chain paths and parents, but it seems like a guessing game of “how many parents might an item have.”
FWIW my Python(s) are installed via brew on macOS High Sierra:
12:00 $ which python
/usr/bin/python
✔ ~/Downloads
12:04 $ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
I’m sure I’m missing something simple. Thanks for your hard work on this! I want to get it going and then just cron it (or equivalent). 😄
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Move file and directory into a sub-directory along with commit ...
In stead of using an inefficient --tree-filter I move the files directly on the index With an --index-filter . git filter-branch -f --index- ......
Read more >PowerShell Move-Item examples for file, folder management
You can move files, while maintaining the folder structure, ... The following command puts the files into a subdirectory called Target:
Read more >Find Files Faster: How to Organize Files and Folders - Zapier
"To review" and "from review" subfolders. This strategy starts with the same top-level folders as the example above, but instead focuses on ...
Read more >Git: move files in an subfolder keeping history - gists · GitHub
Change structure of project folder with Git. I have this structure: project-folder/ .git wp-admin/ wp-content/ wp-includes/ .htaccess .
Read more >How to move a file recursively based on size and keep structure
The easy way is with zsh. You can use glob qualifiers to match files according to criteria such as their type and size....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Test successful!
Made a new empty TESTFOLDER dir, with new FONTS dir inside. Copied the
Backspacer...
folder into TESTFOLDER/, and ranorganize sim
:This bugged me a lot so I just uploaded a new version of organize. Please update with
pip3 install -U organize-tool
and try it out: