<commit_before>#!/bin/sh -ex

die() {
    echo "$@" >&2
    exit 1
}

protoc_ver=$(protoc --version)
case "$protoc_ver" in
    "libprotoc 3"*) ;;
    *)
        die "you need to use protobuf 3 to regenerate .rs from .proto"
    ;;
esac

where_am_i=$(cd `dirname $0`/..; pwd)
PATH="$where_am_i/target/debug:$PATH"

protoc --rust_out . -Iproto \
    proto/google/protobuf/*.proto \
    proto/google/protobuf/compiler/* \
    proto/rustproto.proto

mv descriptor.rs plugin.rs rustproto.rs lib/

# vim: set ts=4 sw=4 et:<commit_msg>Do not write temporary files to current directory<commit_after>#!/bin/sh -ex

die() {
    echo "$@" >&2
    exit 1
}

protoc_ver=$(protoc --version)
case "$protoc_ver" in
    "libprotoc 3"*) ;;
    *)
        die "you need to use protobuf 3 to regenerate .rs from .proto"
    ;;
esac

where_am_i=$(cd `dirname $0`/..; pwd)
PATH="$where_am_i/target/debug:$PATH"

rm -rf tmp-generated
mkdir tmp-generated

protoc --rust_out tmp-generated -Iproto \
    proto/google/protobuf/*.proto \
    proto/google/protobuf/compiler/* \
    proto/rustproto.proto

mv tmp-generated/descriptor.rs tmp-generated/plugin.rs tmp-generated/rustproto.rs lib/

# vim: set ts=4 sw=4 et:
{'fraction_non_alphanumeric': 0.15572390572390574, 'fraction_numerical': 0.011784511784511785, 'mean_word_length': 3.0033670033670035, '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': '5958490', 'n_tokens_mistral': 456, 'n_tokens_neox': 438, 'n_words': 108}