Skip to content

Commit 88fccae

Browse files
committed
Replace one at a time
1 parent d4f65a9 commit 88fccae

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

src/ResearchSoftwareMetadata.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,18 @@ function crosswalk(git_dir = readchomp(`$(Git.git()) rev-parse --show-toplevel`)
458458
name_list = join(just_names, ", ", " and ")
459459
json = JSON.parse(String(response.body))
460460
open_license = json["isOsiApproved"]
461-
text = json["licenseText"]
462-
content = replace(text,
463-
r"<year>"i => years,
464-
r"<owners?>"i => name_list,
465-
r"<copyright holders?>"i => name_list,
466-
r"<Owner Organization Name>"i => name_list,
467-
r"<Asset Owner>"i => name_list,
468-
r"<HOLDERS?>"i => name_list,
469-
r"<name of author>"i => name_list,
470-
r"<author's name or designee>"i => name_list)
461+
content = json["licenseText"]
462+
replaces = [r"<year>"i => years,
463+
r"<owners?>"i => name_list,
464+
r"<copyright holders?>"i => name_list,
465+
r"<Owner Organization Name>"i => name_list,
466+
r"<Asset Owner>"i => name_list,
467+
r"<HOLDERS?>"i => name_list,
468+
r"<name of author>"i => name_list,
469+
r"<author's name or designee>"i => name_list]
470+
for r in replaces
471+
content = replace(content, r)
472+
end
471473
file = joinpath(git_dir, "LICENSE")
472474
open(file, "w") do file
473475
return write(file, content)

0 commit comments

Comments
 (0)