files.sort make no difference for files itself
Signed-off-by: Lu Kaiyi 2392863668@qq.com --- container/assign-account/get_account_info.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/container/assign-account/get_account_info.rb b/container/assign-account/get_account_info.rb index 67c4c46..af08d91 100755 --- a/container/assign-account/get_account_info.rb +++ b/container/assign-account/get_account_info.rb @@ -76,11 +76,11 @@ class AccountStorage end
def build_account_name(available_dir, files) - files.sort + files.sort! account_info = [] - account_info.push files[0] - source_file = File.join(available_dir, files[0]) - account_info.push File.readlines(source_file)[0].chomp + account_info.push files.first + source_file = File.join(available_dir, files.first) + account_info.push File.readlines(source_file).first.chomp
dest_dir = File.join(@account_dir, 'assigned-users') FileUtils.mv(source_file, dest_dir)