s
This commit is contained in:
@@ -16,7 +16,7 @@ bash /tmp/install_v.sh --analyzer --herolib
|
||||
|
||||
```bash
|
||||
|
||||
#~/code/github/freeflowuniverse/herolib/install_v.sh --help
|
||||
~/code/github/freeflowuniverse/herolib/install_v.sh --help
|
||||
|
||||
V & HeroLib Installer Script
|
||||
|
||||
|
||||
@@ -89,5 +89,6 @@ fn hero_upload() ! {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
//os.execute_or_panic('${os.home_dir()}/code/github/freeflowuniverse/herolib/cli/compile.vsh -p')
|
||||
hero_upload() or { eprintln(err) exit(1) }
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ fn do() ! {
|
||||
mut cmd := Command{
|
||||
name: 'hero'
|
||||
description: 'Your HERO toolset.'
|
||||
version: '2.0.0'
|
||||
version: '2.0.2'
|
||||
}
|
||||
|
||||
// herocmds.cmd_run_add_flags(mut cmd)
|
||||
|
||||
77
install_hero.sh
Executable file
77
install_hero.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
set -e
|
||||
|
||||
os_name="$(uname -s)"
|
||||
arch_name="$(uname -m)"
|
||||
|
||||
# Select the URL based on the platform
|
||||
if [[ "$os_name" == "Linux" && "$arch_name" == "x86_64" ]]; then
|
||||
url="https://f003.backblazeb2.com/file/threefold/linux-i64/hero"
|
||||
elif [[ "$os_name" == "Darwin" && "$arch_name" == "arm64" ]]; then
|
||||
url="https://f003.backblazeb2.com/file/threefold/macos-arm64/hero"
|
||||
# elif [[ "$os_name" == "Darwin" && "$arch_name" == "x86_64" ]]; then
|
||||
# url="https://f003.backblazeb2.com/file/threefold/macos-i64/hero"
|
||||
else
|
||||
echo "Unsupported platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${OSNAME}" == "darwin"* ]]; then
|
||||
[ -f /usr/local/bin/hero ] && rm /usr/local/bin/hero
|
||||
fi
|
||||
|
||||
if [ -z "$url" ]; then
|
||||
echo "Could not find url to download."
|
||||
echo $urls
|
||||
exit 1
|
||||
fi
|
||||
zprofile="${HOME}/.zprofile"
|
||||
hero_bin_path="${HOME}/hero/bin"
|
||||
temp_file="$(mktemp)"
|
||||
|
||||
# Check if ~/.zprofile exists
|
||||
if [ -f "$zprofile" ]; then
|
||||
# Read each line and exclude any that modify the PATH with ~/hero/bin
|
||||
while IFS= read -r line; do
|
||||
if [[ ! "$line" =~ $hero_bin_path ]]; then
|
||||
echo "$line" >> "$temp_file"
|
||||
fi
|
||||
done < "$zprofile"
|
||||
else
|
||||
touch "$zprofile"
|
||||
fi
|
||||
# Add ~/hero/bin to the PATH statement
|
||||
echo "export PATH=\$PATH:$hero_bin_path" >> "$temp_file"
|
||||
# Replace the original .zprofile with the modified version
|
||||
mv "$temp_file" "$zprofile"
|
||||
# Ensure the temporary file is removed (in case of script interruption before mv)
|
||||
trap 'rm -f "$temp_file"' EXIT
|
||||
|
||||
# Output the selected URL
|
||||
echo "Download URL for your platform: $url"
|
||||
|
||||
# Download the file
|
||||
curl -o /tmp/downloaded_file -L "$url"
|
||||
|
||||
# Check if file size is greater than 10 MB
|
||||
file_size=$(du -m /tmp/downloaded_file | cut -f1)
|
||||
if [ "$file_size" -ge 2 ]; then
|
||||
# Create the target directory if it doesn't exist
|
||||
mkdir -p ~/hero/bin
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# Move and rename the file
|
||||
mv /tmp/downloaded_file ~/hero/bin/hero
|
||||
chmod +x ~/hero/bin/hero
|
||||
else
|
||||
mv /tmp/downloaded_file /usr/local/bin/hero
|
||||
chmod +x /usr/local/bin/hero
|
||||
fi
|
||||
|
||||
echo "Hero installed properly"
|
||||
export PATH=$PATH:$hero_bin_path
|
||||
hero -version
|
||||
else
|
||||
echo "Downloaded file is less than 10 MB. Process aborted."
|
||||
exit 1
|
||||
fi
|
||||
@@ -7,7 +7,7 @@ pub struct BuilderFactory {
|
||||
}
|
||||
|
||||
pub fn new() !BuilderFactory {
|
||||
mut c := base.context()!
|
||||
_ := base.context()!
|
||||
mut bf := BuilderFactory{}
|
||||
return bf
|
||||
}
|
||||
|
||||
@@ -83,21 +83,21 @@ fn cmd_docusaurus_execute(cmd Command) ! {
|
||||
|
||||
if build{
|
||||
// Create a new docusaurus site
|
||||
mut site := docs.build(
|
||||
_ := docs.build(
|
||||
url:url
|
||||
)!
|
||||
}
|
||||
|
||||
if builddev{
|
||||
// Create a new docusaurus site
|
||||
mut site := docs.build_dev(
|
||||
_ := docs.build_dev(
|
||||
url:url
|
||||
)!
|
||||
}
|
||||
|
||||
if dev{
|
||||
// Create a new docusaurus site
|
||||
mut site := docs.dev(
|
||||
_ := docs.dev(
|
||||
url:url
|
||||
)!
|
||||
}
|
||||
|
||||
@@ -20,16 +20,15 @@ pub fn play_core(mut plbook playbook.PlayBook) ! {
|
||||
|
||||
if p.exists('coderoot') {
|
||||
panic('implement')
|
||||
mut coderoot := p.get_path_create('coderoot')!
|
||||
|
||||
mut gs := gittools.get()!
|
||||
// mut coderoot := p.get_path_create('coderoot')!
|
||||
// mut gs := gittools.get()!
|
||||
}
|
||||
action.done = true
|
||||
}
|
||||
|
||||
for mut action in plbook.find(filter: 'session.')! {
|
||||
mut p := action.params
|
||||
mut session := plbook.session
|
||||
// mut p := action.params
|
||||
// mut session := plbook.session
|
||||
|
||||
//!!session.env_set key:'JWT_SHARED_KEY' val:'...'
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ pub fn play_doctree(mut plbook playbook.PlayBook) ! {
|
||||
|
||||
for mut action in plbook.find(filter: 'doctree:add')! {
|
||||
mut p := action.params
|
||||
url := p.get_default('url', '')!
|
||||
path := p.get_default('path', '')!
|
||||
// url := p.get_default('url', '')!
|
||||
// path := p.get_default('path', '')!
|
||||
name := p.get('name')!
|
||||
|
||||
mut tree := trees[name] or { return error('tree ${name} not found') }
|
||||
_ := trees[name] or { return error('tree ${name} not found') }
|
||||
|
||||
// tree.scan(
|
||||
// path: path
|
||||
@@ -63,7 +63,7 @@ pub fn play_doctree(mut plbook playbook.PlayBook) ! {
|
||||
for mut action in plbook.find(filter: 'doctree:export')! {
|
||||
panic('implement')
|
||||
mut p := action.params
|
||||
name := p.get('name')!
|
||||
_ := p.get('name')!
|
||||
action.done = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,13 @@ import freeflowuniverse.herolib.core.playbook
|
||||
import os
|
||||
|
||||
pub fn play_luadns(mut plbook playbook.PlayBook) ! {
|
||||
mut buildroot := '${os.home_dir()}/hero/var/mdbuild'
|
||||
mut publishroot := '${os.home_dir()}/hero/www/info'
|
||||
mut coderoot := ''
|
||||
// Variables below are not used, commenting them out
|
||||
// mut buildroot := '${os.home_dir()}/hero/var/mdbuild'
|
||||
// mut publishroot := '${os.home_dir()}/hero/www/info'
|
||||
// mut coderoot := ''
|
||||
// mut install := false
|
||||
mut reset := false
|
||||
mut pull := false
|
||||
// mut reset := false
|
||||
// mut pull := false
|
||||
|
||||
for mut action in plbook.find(filter: 'luadns.set_domain')! {
|
||||
mut p := action.params
|
||||
|
||||
@@ -51,7 +51,7 @@ fn install_() ! {
|
||||
expand_dir := '/tmp/golang'
|
||||
|
||||
// the downloader is cool, it will check the download succeeds and also check the minimum size
|
||||
dest := osal.download(
|
||||
_ := osal.download(
|
||||
url: url
|
||||
minsize_kb: 40000
|
||||
expand_dir: expand_dir
|
||||
|
||||
@@ -43,8 +43,6 @@ fn upload_() ! {
|
||||
|
||||
fn install_() ! {
|
||||
console.print_header('install rust')
|
||||
version := '1.83.0'
|
||||
|
||||
base.install()!
|
||||
|
||||
pl := core.platform()!
|
||||
|
||||
@@ -30,7 +30,7 @@ fn installed() !bool {
|
||||
|
||||
fn install() ! {
|
||||
console.print_header('install garage_s3')
|
||||
mut installer := get()!
|
||||
//mut installer := get()!
|
||||
// THIS IS EXAMPLE CODEAND NEEDS TO BE CHANGED
|
||||
mut url := ''
|
||||
if core.is_linux_arm()! {
|
||||
@@ -75,7 +75,7 @@ fn startupcmd() ![]zinit.ZProcessNewArgs {
|
||||
}
|
||||
|
||||
fn running_() !bool {
|
||||
mut installer := get()!
|
||||
_ := get()!
|
||||
// THIS IS EXAMPLE CODEAND NEEDS TO BE CHANGED
|
||||
// this checks health of garage_s3
|
||||
// curl http://localhost:3333/api/v1/s --oauth2-bearer 1234 works
|
||||
|
||||
@@ -159,7 +159,7 @@ pub mut:
|
||||
}
|
||||
|
||||
pub fn (mut site DocSite) error(args ErrorArgs) {
|
||||
path2 := pathlib.get(args.path)
|
||||
// path2 := pathlib.get(args.path)
|
||||
e := SiteError{
|
||||
path: args.path
|
||||
msg: args.msg
|
||||
|
||||
Reference in New Issue
Block a user