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

# npm auth
if [ -n "$NPM_AUTH_TOKEN" ]; then
  echo "$NPM_AUTH_TOKEN" > ~/.npmrc
  chmod go-rwx ~/.npmrc
fi
set -x
TARGET=${TARGET:-.}
if [ -z "$VERSION" ]; then
  VERSION=$(mvn -f "$TARGET/../../" help:evaluate -Dexpression=project.version | egrep -v '^\[.*' | xargs) # get "downloading" messages out of the way, if any
  VERSION=$(mvn -f "$TARGET/../../" help:evaluate -Dexpression=project.version | egrep -v '^\[.*' | xargs) # now egrep will work
fi
NPM_VERSION="$VERSION"
if [[ "$NPM_VERSION" =~ /\-SNAPSHOT$/ ]]; then # translate -SNAPSHOT to -pre.YYYYmmddHHMMSS
  if [ -z "$INSTANT" ]; then
    INSTANT=$(date --utc +%Y%m%d%H%M%S)
  fi
  SUFFIX="-pre.$INSTANT"
  NPM_VERSION=$(echo -n "$NPM_VERSION" | sed -E "s,\\-SNAPSHOT$,$SUFFIX,g")
  find "$TARGET" -name package.json | xargs sed -i.SNAPSHOT -E "s,\\-SNAPSHOT,$SUFFIX,g"
  rm -f "$TARGET/package.json.SNAPSHOT"
fi
npm publish "$TARGET" --tag "$NPM_VERSION"<commit_msg>fix npm-publish.sh defaults<commit_after>#!/usr/bin/env bash

# npm auth
if [ -n "$NPM_AUTH_TOKEN" ]; then
  echo "$NPM_AUTH_TOKEN" > ~/.npmrc
  chmod go-rwx ~/.npmrc
fi
set -x
TARGET=${TARGET:-./target/npm}
if [ -z "$VERSION" ]; then
  VERSION=$(mvn -f "$TARGET/../../" help:evaluate -Dexpression=project.version | egrep -v '^\[.*' | xargs) # get "downloading" messages out of the way, if any
  VERSION=$(mvn -f "$TARGET/../../" help:evaluate -Dexpression=project.version | egrep -v '^\[.*' | xargs) # now egrep will work
fi
NPM_VERSION="$VERSION"
if [[ "$NPM_VERSION" =~ /\-SNAPSHOT$/ ]]; then # translate -SNAPSHOT to -pre.YYYYmmddHHMMSS
  if [ -z "$INSTANT" ]; then
    INSTANT=$(date --utc +%Y%m%d%H%M%S)
  fi
  SUFFIX="-pre.$INSTANT"
  NPM_VERSION=$(echo -n "$NPM_VERSION" | sed -E "s,\\-SNAPSHOT$,$SUFFIX,g")
  sed -i.SNAPSHOT -E "s,\\-SNAPSHOT,$SUFFIX,g" "$TARGET/package.json"
  rm -f "$TARGET/package.json.SNAPSHOT"
fi
npm publish "$TARGET"
{'fraction_non_alphanumeric': 0.21514360313315928, 'fraction_numerical': 0.0, 'mean_word_length': 3.583732057416268, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7085376', 'n_tokens_mistral': 796, 'n_tokens_neox': 788, 'n_words': 183}