Convert REQUIRE to Project.toml and Manifest.toml

I have updated the script to work with Julia 1.5
When I ran the script, I was getting:

ERROR: LoadError: type Nothing has no field uuid

import Pkg
import Base: SHA1
using SHA, UUIDs

function uuid5(namespace::UUID, key::String)
    data = [reinterpret(UInt8, [namespace.value]); codeunits(key)]
    u = reinterpret(UInt128, sha1(data)[1:16])[1]
    u &= 0xffffffffffff0fff3fffffffffffffff
    u |= 0x00000000000050008000000000000000
    return UUID(u)
end

uuid5(namespace::UUID, key::AbstractString) = uuid5(namespace, String(key))

const uuid_dns = UUID(0x6ba7b810_9dad_11d1_80b4_00c04fd430c8)
const uuid_julia_project = uuid5(uuid_dns, "julialang.org")
const uuid_package = uuid5(uuid_julia_project, "package")



"""
    generate_project_toml([name::String])

Generate Project.toml file for the existing current project at `\$PWD`.
It activates the generated Project.toml and then adds packages based on
REQUIRE file.
"""
function generate_project_toml(name::AbstractString = guess_project_name())
    pkg_UUID = uuid5(uuid_package, name)
    if isfile("Project.toml")
        error("Project.toml exists.")
    end

    if !isfile("REQUIRE")
        error("REQUIRE file not found.")
    end
    deps = read_require("REQUIRE")

    pkg = Base.identify_package(name)
    project_toml = """
    name = $(repr(name))
    uuid = "$(pkg_UUID)"
    """
    write("Project.toml", project_toml)

    @info "Activating \$PWD (to run `Pkg.add`)"
    Pkg.activate(pwd())
    Pkg.add(deps)
end

"""
    guess_project_name() :: String

Guess project name using Git.  It works even in worktree repository.
"""
function guess_project_name()
    path = abspath(rstrip(read(`git rev-parse --git-dir`, String)))
    prev = ""
    while path != prev
        if basename(path) == ".git"
            return basename(dirname(path))[1:end-3]
        end
        prev, path = path, dirname(path)
    end
    error("Project not found")
end

function read_require(path)
    deps = String[]
    for line in readlines(path)
        name, = split(line)
        if name == "julia"
            continue
        end
        push!(deps, name)
    end
    return deps
end

Github gist of above script

REF:
https://github.com/JuliaLang/Pkg.jl/commit/34ec22f5405ffc7f8f25a4b4f7178e887f718051
https://github.com/JuliaLang/Pkg.jl/blob/34ec22f5405ffc7f8f25a4b4f7178e887f718051/src/Types.jl
https://github.com/JuliaLang/Pkg.jl/search?p=1&q=gen_project.jl&type=Issues