-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathrun_test.sh
More file actions
executable file
·54 lines (42 loc) · 1.98 KB
/
Copy pathrun_test.sh
File metadata and controls
executable file
·54 lines (42 loc) · 1.98 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -xe
TEMPLATE_PATH="/tmp"
APP_NAME="forum"
cleanup_tmp() {
rm -rf "${TEMPLATE_PATH:?}/$1"
}
print_version() {
echo "$(hc-scaffold --version)"
}
setup_and_build_happ() {
print_version
cleanup_tmp "$1"
cd $TEMPLATE_PATH
hc-scaffold --template svelte web-app "$1" --setup-nix true -F
cd "$1"
hc-scaffold dna forum
hc-scaffold zome posts --integrity dnas/forum/zomes/integrity/ --coordinator dnas/forum/zomes/coordinator/
hc-scaffold entry-type post --reference-entry-hash false --crud crud --link-from-original-to-each-update true --fields title:String:TextField,content:String:TextArea
hc-scaffold entry-type comment --reference-entry-hash false --crud crud --link-from-original-to-each-update false --fields post_hash:ActionHash::Post
hc-scaffold entry-type like --reference-entry-hash false --crud crd --fields like_hash:Option\<ActionHash\>::Like,string_list:Vec\<String\>
hc-scaffold entry-type certificate --reference-entry-hash true --crud cr --fields post_hash:ActionHash::Post,agent:AgentPubKey::certified,certifications_hashes:Vec\<EntryHash\>::Certificate,certificate_type:Enum::CertificateType:TypeOne.TypeTwo,dna_hash:DnaHash
hc-scaffold collection global all_posts post
hc-scaffold collection by-author posts_by_author post
hc-scaffold collection global all_likes like
hc-scaffold collection global all_posts_entry_hash post:EntryHash
hc-scaffold collection by-author posts_by_author_entry_hash post:EntryHash
hc-scaffold link-type post like --delete true --bidirectional false
hc-scaffold link-type comment like:EntryHash --delete true --bidirectional true
hc-scaffold link-type certificate:EntryHash like --delete false --bidirectional false
hc-scaffold link-type agent:creator post:EntryHash --delete false --bidirectional true
nix develop --command bash -c "
set -e
npm install
npm run test
npm run package
cargo clippy --all -- -D warnings
"
cd ..
}
cleanup_tmp "$APP_NAME"
setup_and_build_happ "$APP_NAME"