<commit_before>#!/usr/bin/env bash

set -o posix

set -e

# Ensures the current node is running, otherwise fails
require_live_node() {
    if ! release_ctl ping --peer="$NAME" --cookie="$COOKIE" >/dev/null; then
        fail "Node $NAME is not running!"
    else
        return 0
    fi
}

# Get node pid
get_pid() {
    if output="$(release_remote_ctl rpc ':os.getpid()')"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    "$BINDIR/erl" -noshell \
                  -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host])' \
                  "${NAME_TYPE}" "$id" \
                  -s erlang halt
}<commit_msg>Fix #489 - use erl helper when generating nodename to prevent missing bootfile error<commit_after>#!/usr/bin/env bash

set -o posix

set -e

# Ensures the current node is running, otherwise fails
require_live_node() {
    if ! release_ctl ping --peer="$NAME" --cookie="$COOKIE" >/dev/null; then
        fail "Node $NAME is not running!"
    else
        return 0
    fi
}

# Get node pid
get_pid() {
    if output="$(release_remote_ctl rpc ':os.getpid()')"
    then
        echo "$output" | sed -e 's/"//g'
        return 0
    else
        echo "$output"
        return 1
    fi
}

# Generate a unique nodename
gen_nodename() {
    id="longname$(gen_id)-${NAME}"
    erl -noshell \
        "${NAME_TYPE}" "$id" \
        -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host])' \
        -s erlang halt
}
{'fraction_non_alphanumeric': 0.15722120658135283, 'fraction_numerical': 0.005484460694698354, 'mean_word_length': 2.33739837398374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3590329', 'n_tokens_mistral': 586, 'n_tokens_neox': 563, 'n_words': 158}