Skip to content

Commit

Permalink
Quote files removed with git rm -rf. (#491)
Browse files Browse the repository at this point in the history
* Quote files removed with `git rm -rf`.

* Use the right string format for .format.

* Use the same string formatting conventions as other code areas.
  • Loading branch information
nuclearsandwich committed Dec 4, 2018
1 parent 431b3ad commit 54a41a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bloom/commands/git/patch/trim_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _trim(config, force, directory):
items.append(item)
# Remove and .* files missed by 'git rm -rf *'
if len(items) > 0:
execute_command('git rm -rf ' + ' '.join(items), cwd=directory)
execute_command('git rm -rf ' + ' '.join(["'{}'".format(i) for i in items if i]), cwd=directory)
# Copy the sub directory back
for item in os.listdir(storage):
src = os.path.join(storage, item)
Expand Down
2 changes: 1 addition & 1 deletion bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def generate_debian(self, package, debian_distro):
# Template files
template_files = process_template_files('.', subs)
# Remove any residual template files
execute_command('git rm -rf ' + ' '.join(template_files))
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
# Add changes to the debian folder
execute_command('git add debian')
# Commit changes
Expand Down
2 changes: 1 addition & 1 deletion bloom/generators/rpm/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def generate_rpm(self, package, rpm_distro, rpm_dir='rpm'):
# Template files
template_files = process_template_files('.', subs)
# Remove any residual template files
execute_command('git rm -rf ' + ' '.join(template_files))
execute_command('git rm -rf ' + ' '.join("'{}'".format(t) for t in template_files))
# Add changes to the rpm folder
execute_command('git add ' + rpm_dir)
# Commit changes
Expand Down

0 comments on commit 54a41a0

Please sign in to comment.