Skip to content

Commit

Permalink
chore: add checkout script for model training
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Nov 4, 2023
1 parent 553d7db commit f9ed75c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions model/checkout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

set -ex

declare -r categories=("jsfuck" "jjencode" "uglify" "obfuscate" "jsconfuser" "jsconfuser-minified" "sake")

cd model

mkdir -p training/plain
for item in "${categories[@]}"; do
mkdir -p training/$item
done

mkdir -p test/plain
for item in "${categories[@]}"; do
mkdir -p test/$item
done

mkdir -p export

if [[ ! -d "jquery" ]]; then
git clone --depth=1 https://github.com/jquery/jquery
fi

if [[ ! -d "Leaflet" ]]; then
git clone --depth=1 https://github.com/Leaflet/Leaflet
fi

if [[ ! -d "svelte" ]]; then
git clone --depth=1 https://github.com/sveltejs/svelte
fi

if [[ ! -d "mocha" ]]; then
git clone --depth=1 https://github.com/mochajs/mocha
fi

find . -wholename "./jquery/src/**.js" -exec cp {} ./training/plain/ \;
find . -wholename "./mocha/lib/**.js" -exec cp {} ./training/plain/ \;
find . -wholename "./svelte/packages/svelte/src/**.js" -exec cp {} ./training/plain/ \;
find . -wholename "./Leaflet/src/**.js" -exec cp {} ./test/plain/ \;

for item in "${categories[@]}"; do
node ./encode-w-"$item".js training
done

for item in "${categories[@]}"; do
node ./encode-w-"$item".js test
done

0 comments on commit f9ed75c

Please sign in to comment.