Merge pull request #343 from mlk/hdfs-rm-rm_X_Is_a_directory_add_minus_r
hdfs -rm -r /directory and hdfs -mkdir -p /directory/sub support
This commit is contained in:
@@ -10,4 +10,4 @@ def match(command, settings):
|
||||
|
||||
@sudo_support
|
||||
def get_new_command(command, settings):
|
||||
return re.sub('^mkdir (.*)', 'mkdir -p \\1', command.script)
|
||||
return re.sub('\\bmkdir (.*)', 'mkdir -p \\1', command.script)
|
||||
|
||||
@@ -10,4 +10,7 @@ def match(command, settings):
|
||||
|
||||
@sudo_support
|
||||
def get_new_command(command, settings):
|
||||
return re.sub('^rm (.*)', 'rm -rf \\1', command.script)
|
||||
arguments = '-rf'
|
||||
if 'hdfs' in command.script:
|
||||
arguments = '-r'
|
||||
return re.sub('\\brm (.*)', 'rm ' + arguments + ' \\1', command.script)
|
||||
|
||||
Reference in New Issue
Block a user