<commit_before>#!/bin/bash
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#
# Copyright (c) 2015, Joyent, Inc.
#

set -o xtrace

ROOT=$(cd `dirname $0`/../ 2>/dev/null && pwd)

export PREFIX=$npm_config_prefix
export ETC_DIR=$npm_config_etc
export SMF_DIR=$npm_config_smfdir
export VERSION=$npm_package_version
export ENABLED=true

. /lib/sdc/config.sh
load_sdc_config

AGENT=$npm_package_name


# ---- support functions

function fatal()
{
    echo "error: $*" >&2
    exit 1
}

function warn_and_exit()
{
    echo "warning: $*" >&2
    exit 0
}

function subfile() {
  IN=$1
  OUT=$2
  if [[ -z "$3" ]]; then
    sed -e "s#@@PREFIX@@#$PREFIX#g" \
        -e "s/@@VERSION@@/$VERSION/g" \
        -e "s#@@ROOT@@#$ROOT#g" \
        -e "s/@@ENABLED@@/false/g" \
        -e "s/@@PORT@@/5310/g"
        $IN > $OUT
  else
    sed -e "s#@@PREFIX@@#$PREFIX#g" \
        -e "s/@@VERSION@@/$VERSION/g" \
        -e "s#@@ROOT@@#$ROOT#g" \
        -e "s/@@ENABLED@@/$ENABLED/g" \
        -e "s/@@PORT@@/5309/g"
        $IN > $OUT
  fi<commit_msg>AGENT-794: Fix npm postinstall script<commit_after>#!/bin/bash
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#
# Copyright (c) 2015, Joyent, Inc.
#

set -o xtrace

ROOT=$(cd `dirname $0`/../ 2>/dev/null && pwd)

export PREFIX=$npm_config_prefix
export ETC_DIR=$npm_config_etc
export SMF_DIR=$npm_config_smfdir
export VERSION=$npm_package_version
export ENABLED=true

. /lib/sdc/config.sh
load_sdc_config

AGENT=$npm_package_name


# ---- support functions

function fatal()
{
    echo "error: $*" >&2
    exit 1
}

function warn_and_exit()
{
    echo "warning: $*" >&2
    exit 0
}

function subfile() {
  IN=$1
  OUT=$2
  if [[ ! -z "$3" ]]; then
    sed -e "s#@@PREFIX@@#$PREFIX#g" \
        -e "s/@@VERSION@@/$VERSION/g" \
        -e "s#@@ROOT@@#$ROOT#g" \
        -e "s/@@ENABLED@@/false/g" \
        -e "s/@@PORT@@/5310/g" \
        $IN > $OUT
  else
    sed -e "s#@@PREFIX@@#$PREFIX#g" \
        -e "s/@@VERSION@@/$VERSION/g" \
        -e "s#@@ROOT@@#$ROOT#g" \
        -e "s/@@ENABLED@@/$ENABLED/g" \
        -e "s/@@PORT@@/5309/g" \
        $IN > $OUT
  fi
{'fraction_non_alphanumeric': 0.19345484672742336, 'fraction_numerical': 0.021955260977630488, 'mean_word_length': 2.5462555066079293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '873022', 'n_tokens_mistral': 1020, 'n_tokens_neox': 984, 'n_words': 229}