@@ -7,11 +7,11 @@ import {
77 ensureDir ,
88 getNowForFilename ,
99 demos_dir ,
10- rust_template_dir ,
1110 settings as global_settings ,
1211 encode ,
1312 languages ,
1413 settings ,
14+ copyDirectory ,
1515} from "./util.js" ;
1616
1717export const sessions_dir = data_dir . get_child ( "sessions" ) ;
@@ -64,7 +64,6 @@ export function createSessionFromDemo(demo) {
6464
6565 const { file, settings } = session ;
6666 copyDirectory ( demo_dir , file ) ;
67- copyDirectory ( rust_template_dir , file ) ;
6867
6968 settings . set_string ( "name" , name ) ;
7069 settings . set_boolean ( "show-code" , panels . includes ( "code" ) ) ;
@@ -79,24 +78,6 @@ export function createSessionFromDemo(demo) {
7978 return session ;
8079}
8180
82- // There is no copy directory function
83- function copyDirectory ( source , destination ) {
84- for ( const file_info of source . enumerate_children (
85- "" ,
86- Gio . FileQueryInfoFlags . NOFOLLOW_SYMLINKS ,
87- null ,
88- ) ) {
89- if ( file_info . get_file_type ( ) === Gio . FileType . DIRECTORY ) continue ;
90- const child = source . get_child ( file_info . get_name ( ) ) ;
91- child . copy (
92- destination . get_child ( child . get_basename ( ) ) ,
93- Gio . FileCopyFlags . NONE ,
94- null ,
95- null ,
96- ) ;
97- }
98- }
99-
10081export async function deleteSession ( session ) {
10182 // There is no method to recursively delete a folder so we trash instead
10283 // https://github.com/flatpak/xdg-desktop-portal/issues/630 :/
0 commit comments