5
5
// Author: Andreas Timm
6
6
// Repository: https://github.com/andreas-timm/code-signature-ts
7
7
// Version: 0.4.0
8
- // @sha 256sum 0xe901425d12469ef7e0fdd010e2d158d5398a8a6ae7e1a79bce1f77a6b9d3237b
9
- // @eip 191signature 0x3b08f924e994205005312fec95c30e181fb066744ca51a17d122221953cda7e37abec4184e1755385cae7837cea1a6e6f74b3d336484026338bf6d2426e9f9be1c
8
+ // @sha 256sum 0x004449b7297c9c7332cb590a46ddddd5640fb79912b57f027f77df816b883c5c
9
+ // @eip 191signature 0x8f23ab609c8c2f00f9ebbd9e0e78d3cb62a273e74ccbe1aa21a0207aa26a76ad2d97333c219e7da1ba3382ed19585bb24d666bceae3e850124f454dd1d1cd2251c
10
10
11
11
import { parseArgs } from 'util'
12
12
import { hashMessage , recoverAddress , sha256 } from 'viem'
@@ -116,6 +116,7 @@ function printHelp() {
116
116
console . log ( 'OPTIONS:' )
117
117
console . log ( ' --verify, -v — only verify' )
118
118
console . log ( ' --write, -w — write file' )
119
+ console . log ( ' --force, -f - force write' )
119
120
console . log ( ' --silent, -s — silent' )
120
121
console . log ( ' --prefix, -p — commented line prefix' )
121
122
console . log ( ' --out, -o — output file' )
@@ -165,7 +166,7 @@ export async function codeSignature(options: Options) {
165
166
signResult = await sign ( verifyResult , options )
166
167
167
168
if ( signResult . signedContent !== null ) {
168
- if ( options . write && fail ) {
169
+ if ( options . write && ( fail || options . force ) ) {
169
170
await write ( options , signResult . signedContent )
170
171
}
171
172
@@ -192,6 +193,7 @@ export async function codeSign() {
192
193
options : {
193
194
help : { type : 'boolean' , short : 'h' , default : false } ,
194
195
write : { type : 'boolean' , short : 'w' , default : false } ,
196
+ force : { type : 'boolean' , short : 'f' , default : false } ,
195
197
verify : { type : 'boolean' , short : 'v' , default : false } ,
196
198
silent : { type : 'boolean' , short : 's' , default : false } ,
197
199
prefix : { type : 'string' , short : 'p' , default : '//' } ,
0 commit comments