File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2879,6 +2879,10 @@ window.navbar_path_droppable = (el_window)=>{
2879
2879
*
2880
2880
*/
2881
2881
window . navbar_path = ( abs_path ) => {
2882
+ // remove trailing slash
2883
+ if ( abs_path . endsWith ( '/' ) && abs_path !== '/' )
2884
+ abs_path = abs_path . slice ( 0 , - 1 ) ;
2885
+
2882
2886
const dirs = ( abs_path === '/' ? [ '' ] : abs_path . split ( '/' ) ) ;
2883
2887
const dirpaths = ( abs_path === '/' ? [ '/' ] : [ ] )
2884
2888
const path_seperator_html = `<img class="path-seperator" draggable="false" src="${ html_encode ( window . icons [ 'triangle-right.svg' ] ) } ">` ;
Original file line number Diff line number Diff line change @@ -129,6 +129,20 @@ const launch_app = async (options)=>{
129
129
else
130
130
title = path . dirname ( options . path ) ;
131
131
132
+ // if options.args.path is provided, use it as the path
133
+ if ( options . args ?. path ) {
134
+ // if args.path is provided, enforce the directory
135
+ let fsentry = await puter . fs . stat ( options . args . path ) ;
136
+ if ( ! fsentry . is_dir ) {
137
+ let parent = path . dirname ( options . args . path ) ;
138
+ if ( parent === options . args . path )
139
+ parent = window . home_path ;
140
+ options . path = parent ;
141
+ } else {
142
+ options . path = options . args . path ;
143
+ }
144
+ }
145
+
132
146
// open window
133
147
el_win = UIWindow ( {
134
148
element_uuid : uuid ,
You can’t perform that action at this time.
0 commit comments