-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostbuild_fixups.sh
executable file
·39 lines (33 loc) · 1.41 KB
/
postbuild_fixups.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
version=${1?Please specify version}
# src/DashTextareaAutocomplete
declare -a moduleregs=(\
's/const resources_path = realpath(joinpath( @__DIR__, \"..\", \"deps\"))/resources_path() = artifact\"dash_textarea_autocomplete_resources\"/' \
's/using Dash/using Dash, Pkg.Artifacts/' \
's/ resources_path,/ resources_path(),/' \
)
for reg in "${moduleregs[@]}"
do
sed -i "$reg" src/DashTextareaAutocomplete.jl
done
# Project.toml
declare -a projectregs=(\
's/\[deps\]/\[deps\]\nPkg = \"44cfe95a-1eb2-52ea-b672-e2afdf69b78f\"/' \
's/Dash = \"0.1.3\"/Dash = \"0.1.3, 1.0\"/' \
's/julia = \"1.2\"/julia = \"1.3\"/')
for reg in "${projectregs[@]}"
do
sed -i "$reg" Project.toml
done
# Artifacts.toml
julia -e 'using Pkg; Pkg.activate(; temp=true); Pkg.add("Inflate"); \
using TOML, SHA, Tar, Inflate; \
version = TOML.tryparsefile("Project.toml")["version"]; \
filename = "deps/deps.tar.gz"; \
res_key = "dash_textarea_autocomplete_resources"; \
dl_key = "dash_textarea_autocomplete_resources"; \
d = TOML.tryparsefile("Artifacts.toml"); \
d[res_key]["git-tree-sha1"] = Tar.tree_hash(IOBuffer(inflate_gzip(filename))); \
d[dl_key]["download"][1]["sha256"] = bytes2hex(open(sha256, filename)); \
d[dl_key]["download"][1]["url"] = "https://unpkg.com/dash-textarea-autocomplete@$(version)/deps/deps.tar.gz"; \
open(io -> TOML.print(io, d), "Artifacts.toml", "w");'