File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -866,9 +866,20 @@ impl Executor {
866
866
867
867
// ファイルを開く
868
868
"open" => {
869
- let _result = std:: process:: Command :: new ( "cmd" )
870
- . args ( & [ "/C" , "start" , "" , self . pop_stack ( ) . get_string ( ) . as_str ( ) ] )
871
- . spawn ( ) ;
869
+ if cfg ! ( target_os = "windows" ) {
870
+ let _result = std:: process:: Command :: new ( "cmd" )
871
+ . args ( & [ "/C" , "start" , "" , self . pop_stack ( ) . get_string ( ) . as_str ( ) ] )
872
+ . spawn ( ) ;
873
+ } else if cfg ! ( target_os = "linux" ) {
874
+ let _result =
875
+ std:: process:: Command :: new ( "xdg-open" ) // Linuxの場合
876
+ . arg ( self . pop_stack ( ) . get_string ( ) . as_str ( ) )
877
+ . spawn ( ) ;
878
+ } else if cfg ! ( target_os = "macos" ) {
879
+ let _result = std:: process:: Command :: new ( "open" )
880
+ . arg ( self . pop_stack ( ) . get_string ( ) . as_str ( ) )
881
+ . spawn ( ) ;
882
+ }
872
883
}
873
884
874
885
// シェルコマンドを実行
You can’t perform that action at this time.
0 commit comments