Hi everyone, I am facing recently a problem after I updated my code on my project.
When I call this function, at runtime crystal complain about that function can return a Tuple(UInt128, UInt128, UInt128, UInt128) or NIL.
How that is possible ?
def install : Tuple(UInt128, UInt128, UInt128, UInt128)
Ism.notifyOfInstall(@information)
filesList = Dir.glob(["#{builtSoftwareDirectoryPath(false)}/**/*"], match: :dot_files)
installedFiles = Array(String).new
directoryNumber = UInt128.new(0)
symlinkNumber = UInt128.new(0)
fileNumber = UInt128.new(0)
totalSize = UInt128.new(0)
filesList.each do |entry|
finalDestination = "/#{entry.sub(builtSoftwareDirectoryPath(false),"")}"
if File.directory?(entry)
if !Dir.exists?(finalDestination)
directoryNumber += 1
makeDirectory(finalDestination)
installedFiles << "/#{finalDestination.sub(Ism.settings.rootPath,"")}".squeeze("/")
end
else
if File.symlink?(entry)
symlinkNumber += 1
else
fileNumber += 1
totalSize += File.size(entry)
end
moveFile(entry,finalDestination)
installedFiles << "/#{finalDestination.sub(Ism.settings.rootPath,"")}".squeeze("/")
end
end
Ism.addInstalledSoftware(@information, installedFiles)
return directoryNumber, symlinkNumber, fileNumber, totalSize
end