summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-04-08 01:44:15 +0530
committerAndinus <andinus@nand.sh>2020-04-08 01:44:15 +0530
commit34adb3a7e676a43cd692b4da14398a7d1b0be822 (patch)
tree52d071f21eda3fdeb9768ecefb41df1c7ee551e8 /scripts
parent47d22337b3a178b14e1cac287799f2c9dfb336e6 (diff)
downloadgrus-34adb3a7e676a43cd692b4da14398a7d1b0be822.tar.gz
Prepare for next rewrite
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/grus-add56
-rwxr-xr-xscripts/init13
-rwxr-xr-xscripts/install.sh56
3 files changed, 0 insertions, 125 deletions
diff --git a/scripts/grus-add b/scripts/grus-add
deleted file mode 100755
index 4c3311a..0000000
--- a/scripts/grus-add
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-import sqlite3
-import argparse
-
-parser = argparse.ArgumentParser(description='grus-add')
-parser.add_argument('-f', '--file', type=str, required=False,
-                    help='file containing list of strings')
-parser.add_argument('-w', '--word', type=str, required=False,
-                    help='file containing list of strings')
-parser.add_argument('-d', '--db', type=str, required=True,
-                    help='database file')
-args = parser.parse_args()
-
-if __name__ == '__main__':
-    if args.file == None and args.word == None:
-            print("-f or -w required")
-            print("run grus-add --help to print help")
-            sys.exit(1)
-
-    conn = sqlite3.connect(args.db)
-    curs = conn.cursor()
-
-    stmt = """CREATE TABLE IF NOT EXISTS words (
-    word   TEXT PRIMARY KEY NOT NULL,
-    sorted TEXT NOT NULL);"""
-    curs.execute(stmt)
-    conn.commit()
-
-    stmt = """INSERT INTO words(word, sorted)
-    VALUES(?, ?);"""
-
-    if args.file != None:
-        rows = []
-        with open(args.file) as words:
-            for word in words:
-                word = word.strip()
-                lexical = ''.join(sorted(word))
-                rows.append((word, lexical))
-                print(len(rows))
-                sys.stdout.write('\x1b[1A')
-                sys.stdout.write('\x1b[2K')
-        curs.executemany(stmt, rows)
-
-    elif args.word != None:
-        word = args.word.strip()
-        lexical = ''.join(sorted(word))
-        curs.execute(stmt, (word, lexical))
-
-    conn.commit()
-
-    curs.close()
-    conn.close()
-
-    print("Database initialized.")
diff --git a/scripts/init b/scripts/init
deleted file mode 100755
index 1ca1f12..0000000
--- a/scripts/init
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-# Download the list of words.
-curl -o /tmp/words.txt \
-     https://raw.githubusercontent.com/dwyl/english-words/master/words.txt
-
-# Make the script executable.
-chmod +x grus-add
-
-# Add those words to the database.
-./grus-add \
-    -d $HOME/.local/share/grus/grus.db \
-    -f /tmp/words.txt
diff --git a/scripts/install.sh b/scripts/install.sh
deleted file mode 100755
index bc02528..0000000
--- a/scripts/install.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-openbsdH="25a8dc77cda3d225c85d3f0cb318d01c17546c1c4a8c789a318f832ce1948bc3"
-
-earlyCheck(){
-    os=`uname`
-    os=`echo $os | tr "[:upper:]" "[:lower:"]`
-
-    case $os in
-        *openbsd* ) ;;
-        *)
-            echo "Pre-built binary not available for your os"
-            exit 1
-            ;;
-    esac
-
-    cpu=`uname -m`
-    cpu=`echo $cpu | tr "[:upper:]" "[:lower:"]`
-
-    case $cpu in
-        *amd*64* | *x86*64* ) ;;
-        *)
-            echo "Pre-built binary not available for your cpu"
-            exit 1
-            ;;
-    esac
-}
-
-getURL(){
-    url="https://archive.org/download/grus-v0.1.0/grus-v0.1.0-$os-$cpu"
-}
-
-printURL(){
-    echo "You can get the Pre-built binary here:"
-    echo "$url"
-    echo
-    echo "Run these commands to install it on your device."
-    echo "# curl -L -o /usr/local/bin/grus $url"
-    echo "# chmod +x /usr/local/bin/grus"
-    echo
-    echo "This is sha256 hash for grus built for: $os $cpu"
-    case $os in
-        *openbsd* )
-            echo "$openbsdH"
-            ;;
-    esac
-    echo
-    echo "Verify the hash by running sha256 on grus binary."
-    echo "$ sha256 /usr/local/bin/grus"
-}
-
-echo "Grus v0.1.0"
-echo
-earlyCheck
-getURL
-printURL
/a> 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596