File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-cli " : patch:bug
3+ " @tauri-apps/cli " : patch:bug
4+ ---
5+
6+ Fixes truncation of existing BuildTask.kt when running ` tauri android init ` .
Original file line number Diff line number Diff line change @@ -211,7 +211,9 @@ fn generate_out_file(
211211 options. mode ( 0o755 ) ;
212212 }
213213
214- if path. file_name ( ) . unwrap ( ) == OsStr :: new ( "BuildTask.kt" ) || !path. exists ( ) {
214+ if path. file_name ( ) . unwrap ( ) == OsStr :: new ( "BuildTask.kt" ) {
215+ options. truncate ( true ) . create ( true ) . open ( path) . map ( Some )
216+ } else if !path. exists ( ) {
215217 options. create ( true ) . open ( path) . map ( Some )
216218 } else {
217219 Ok ( None )
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ pub fn gen(
155155 let mut options = OpenOptions :: new ( ) ;
156156 options. write ( true ) ;
157157
158- if path . file_name ( ) . unwrap ( ) == OsStr :: new ( "BuildTask.kt" ) || !path. exists ( ) {
158+ if !path. exists ( ) {
159159 options. create ( true ) . open ( path) . map ( Some )
160160 } else {
161161 Ok ( None )
Original file line number Diff line number Diff line change @@ -274,7 +274,7 @@ pub fn generate_android_out_file(
274274 options. mode ( 0o755 ) ;
275275 }
276276
277- if path . file_name ( ) . unwrap ( ) == OsStr :: new ( "BuildTask.kt" ) || !path. exists ( ) {
277+ if !path. exists ( ) {
278278 options. create ( true ) . open ( path) . map ( Some )
279279 } else {
280280 Ok ( None )
You can’t perform that action at this time.
0 commit comments