Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-python
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-python
Commits
e783556e
Commit
e783556e
authored
Feb 20, 2014
by
Aron Griffis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dotglob FTW. Doesn't expand . or .. but be explicit just in case.
parent
5f96190e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
utils
bin/utils
+8
-4
No files found.
bin/utils
View file @
e783556e
...
...
@@ -46,10 +46,10 @@ deep-cp() {
# cp doesn't like being called without source params,
# so make sure they expand to something first.
# subshell to avoid surprising caller with
nullglob
.
# subshell to avoid surprising caller with
shopts
.
(
shopt -s nullglob
set -- "$source"/!(tmp
) "$source"/.{[!.],.?}*
shopt -s nullglob
dotglob
set -- "$source"/!(tmp
|.|..)
[[ $# == 0 ]] || cp -a "$@" "$target"
)
}
...
...
@@ -62,7 +62,11 @@ deep-mv() {
# Does some serious deleting.
deep-rm() {
rm -rf "$1"/!(tmp) "$1"/.{[!.],.?}*
# subshell to avoid surprising caller with shopts.
(
shopt -s dotglob
rm -rf "$1"/!(tmp|.|..)
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment