<commit_before>#!/bin/bash

[[ $DEBUG == true ]] && set -x

PWD_ORGI=$PWD

ASSETS_DIR=${ASSETS_DIR:-"/etc/docker-assets"}
ROOTFS_DIR=${ROOTFS_DIR:-"$ASSETS_DIR/rootfs"}
CHECKLIST_FILE=${CHECKLIST_FILE:-"$ASSETS_DIR/checklist.md5"}
DEFAULT_ENV_FILE=${DEFAULT_ENV_FILE:-"$ASSETS_DIR/default_env.sh"}
CHMOD_FILE=${CHMOD_FILE:-"$ASSETS_DIR/chmod.list"}
BUILD_SCRIPT=${BUILD_SCRIPT:-"$ASSETS_DIR/build.sh"}
PRE_RUN_SCRIPT=${PRERUN_SCRIPT:="$ASSETS_DIR/pre_run.sh"}
VOLUMES_LIST=${VOLUMES_LIST:="$ASSETS_DIR/volumes.list"}
VOLUMES_ARCHIVE=${VOLUMES_ARCHIVE:="$ASSETS_DIR/volumes.tar"}
INITIALIZED_FLAG=${INITIALIZED_FLAG:="$ASSERS_DIR/initialized.flag"}

ENTRY_PROMPT=${ENTRY_PROMPT:="entrypoint>> "}

case ${1} in
    build)
        # run user defined script
        if [[ -f $BUILD_SCRIPT ]]; then
        echo "$ENTRY_PROMPT running build.sh"
            source $BUILD_SCRIPT
        fi

        set +e

        # generate MD5 list for target files of rootfs, to keep user's modification when docker restart 
        if [[ -d $ROOTFS_DIR ]] && [[ $KEEP_USER_MODIFICATION_ENABLE != false ]] ; then
        echo "$ENTRY_PROMPT generate MD5 list"
            cd $ROOTFS_DIR
            TEMPLATE_VARIABLES=$(find . -type f -exec grep -P -o '(?<={{).+?(?=}})' {} \; | xargs -n 1 echo | sort | uniq ) 
            find . -type f | 
            while read file; do<commit_msg>change default ENTRY_PROMPT<commit_after>#!/bin/bash

[[ $DEBUG == true ]] && set -x

PWD_ORGI=$PWD

ASSETS_DIR=${ASSETS_DIR:-"/etc/docker-assets"}
ROOTFS_DIR=${ROOTFS_DIR:-"$ASSETS_DIR/rootfs"}
CHECKLIST_FILE=${CHECKLIST_FILE:-"$ASSETS_DIR/checklist.md5"}
DEFAULT_ENV_FILE=${DEFAULT_ENV_FILE:-"$ASSETS_DIR/default_env.sh"}
CHMOD_FILE=${CHMOD_FILE:-"$ASSETS_DIR/chmod.list"}
BUILD_SCRIPT=${BUILD_SCRIPT:-"$ASSETS_DIR/build.sh"}
PRE_RUN_SCRIPT=${PRERUN_SCRIPT:="$ASSETS_DIR/pre_run.sh"}
VOLUMES_LIST=${VOLUMES_LIST:="$ASSETS_DIR/volumes.list"}
VOLUMES_ARCHIVE=${VOLUMES_ARCHIVE:="$ASSETS_DIR/volumes.tar"}
INITIALIZED_FLAG=${INITIALIZED_FLAG:="$ASSERS_DIR/initialized.flag"}

ENTRY_PROMPT=${ENTRY_PROMPT:="entrypoint> "}

case ${1} in
    build)
        # run user defined script
        if [[ -f $BUILD_SCRIPT ]]; then
        echo "$ENTRY_PROMPT running build.sh"
            source $BUILD_SCRIPT
        fi

        set +e

        # generate MD5 list for target files of rootfs, to keep user's modification when docker restart 
        if [[ -d $ROOTFS_DIR ]] && [[ $KEEP_USER_MODIFICATION_ENABLE != false ]] ; then
        echo "$ENTRY_PROMPT generate MD5 list"
            cd $ROOTFS_DIR
            TEMPLATE_VARIABLES=$(find . -type f -exec grep -P -o '(?<={{).+?(?=}})' {} \; | xargs -n 1 echo | sort | uniq ) 
            find . -type f | 
            while read file; do
{'fraction_non_alphanumeric': 0.15846994535519127, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 3.694017094017094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3043627', 'n_tokens_mistral': 1068, 'n_tokens_neox': 990, 'n_words': 173}