From dcb098e0c7b5eac1809988b7703b97feab3d9e6b Mon Sep 17 00:00:00 2001 From: ruidajo Date: Thu, 9 Jun 2022 13:51:20 -0500 Subject: [PATCH] Fixing bug at install commons. --- .../NitterUser.class/instance/installCommons.st | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Socialmetrica.package/NitterUser.class/instance/installCommons.st b/Socialmetrica.package/NitterUser.class/instance/installCommons.st index f91aa0d..2970681 100644 --- a/Socialmetrica.package/NitterUser.class/instance/installCommons.st +++ b/Socialmetrica.package/NitterUser.class/instance/installCommons.st @@ -11,11 +11,12 @@ installCommons folder exists ifTrue: [ folder ensureDeleteAllChildren ] ifFalse: [ folder ensureCreateDirectory]. - commonFiles do: [ :fileUrl | + commonFiles do: [ :fileUrl | | temp | ZnClient new url: fileUrl; downloadTo: folder. - (folder children select: [ :file | file basename includesSubstring: 'raw' ]) - renameTo: (((fileUrl splitOn: 'raw?') second splitOn: '/') last removeSuffix: '&ci=tip') + temp := (folder children select: [ :file | file basename includesSubstring: 'raw' ]). + temp isNotEmpty ifTrue: [ + temp first renameTo: (((fileUrl splitOn: 'raw?') second splitOn: '/') last removeSuffix: '&ci=tip')]. ]. ^ folder \ No newline at end of file