Skip to content

Commit

Permalink
chore: #release
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabveer committed Dec 21, 2024
1 parent b3786a9 commit 414c2d1
Show file tree
Hide file tree
Showing 4 changed files with 3,107 additions and 3,323 deletions.
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
24 changes: 14 additions & 10 deletions lib/build-gutka.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,21 @@ const afterBuild = async knex => {
name: 'key',
message: 'Enter encryption key:',
} )
await knex.select().from( 'line_content' ).then( lines => {
console.log( 'Encrypting data...' )
lines.forEach( async line => {
await knex( 'line_content' )
.where( 'line_id', line.line_id )
.update( {
gurmukhi: encrypt( line.gurmukhi, response.key ),
larivaar: encrypt( line.larivaar, response.key ),
} )
if ( response.key.length !== 0 ) {
await knex.select().from( 'line_content' ).then( lines => {
console.log( 'Encrypting data...' )
lines.forEach( async line => {
await knex( 'line_content' )
.where( 'line_id', line.line_id )
.update( {
gurmukhi: encrypt( line.gurmukhi, response.key ),
larivaar: encrypt( line.larivaar, response.key ),
} )
} )
} )
} )
} else {
console.log( 'No key provided. Data not encrypted.'.warning )
}

// Compact sqlite db
await knex.raw( 'VACUUM' )
Expand Down
Loading

0 comments on commit 414c2d1

Please sign in to comment.