<commit_before>#!/bin/bash

set -e

# tl;dr npm i -g with current src as tarball

. scripts/tarball.sh

#inst="$npm_config_prefix"
#[ -z "$inst" ] && inst="/usr"
#inst="$inst/lib/node_modules"

rm -rf .pkg
mkdir .pkg
for f in package* zeronet.js lib .gitignore LICENSE; do cp -r $f .pkg; done
ver=$(echo $(cat package.json | grep "version" | sed "s|\"||g" | sed "s|  ||g" | grep " .*" -o) | sed "s|,||g")
cd .pkg
for f in package*; do sed -r 's|"([a-z-]+)": "file:(.*)"|"\1": "file:../../\2.tar.gz"|g' -i $f; done
ex_re
tar cvfz ../znjs.tar.gz $ex --mode="777" . | sed "s|^|zeronet-js: |g"
mv ../znjs.tar.gz .
npm i ./znjs.tar.gz --production -g<commit_msg>Fix snap once and for all<commit_after>#!/bin/bash

set -e

# tl;dr npm i -g with current src as tarball

. scripts/tarball.sh

#inst="$npm_config_prefix"
#[ -z "$inst" ] && inst="/usr"
#inst="$inst/lib/node_modules"

rm -rf .pkg
mkdir .pkg
for f in package* zeronet.js lib .gitignore LICENSE; do cp -r $f .pkg; done
ver=$(echo $(cat package.json | grep "version" | sed "s|\"||g" | sed "s|  ||g" | grep " .*" -o) | sed "s|,||g")
cd .pkg
for f in package*; do sed -r 's|"([a-z-]+)": "file:(.*)"|"\1": "file:../../\2.tar.gz"|g' -i $f; done
ex_re
tar cvfz ../znjs.tar.gz $ex --mode="777" . | sed "s|^|zeronet-js: |g"
mv ../znjs.tar.gz .
npm i ./znjs.tar.gz --unsafe-perm --production -g
{'fraction_non_alphanumeric': 0.25149253731343285, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 3.0149700598802394, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '7012267', 'n_tokens_mistral': 609, 'n_tokens_neox': 577, 'n_words': 169}