-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
import os | ||
|
||
const ( | ||
sound = $embed_file('../assets/pop.wav') | ||
icon = $embed_file('../assets/emoji-mart.ico') | ||
// Needs to be in another dir else V embeds the wrong file. | ||
sound = $embed_file('../assets/audio/pop.wav') | ||
) | ||
|
||
fn write_embedded() ! { | ||
if !os.exists(paths.ui) { | ||
dist_ui_path := os.join_path('dist', 'ui') | ||
for file in ui { | ||
out_path := file.path.replace(os.join_path(paths.root, 'dist', 'ui'), paths.ui) | ||
os.mkdir_all(os.dir(out_path))! | ||
os.write_file(out_path, file.to_string())! | ||
_, mut out_path := file.path.rsplit_once(dist_ui_path) or { | ||
return error('failed to prepare path for ${file.path}') | ||
} | ||
out_path = os.join_path(paths.ui, out_path) | ||
os.mkdir_all(os.dir(out_path)) or { panic(err) } | ||
os.write_file(out_path, file.to_string()) or { panic(err) } | ||
} | ||
} | ||
if !os.exists(paths.sound) { | ||
path := sound.path.replace('../assets/pop.wav', paths.sound) | ||
os.mkdir_all(os.dir(path)) or {} | ||
os.write_file(path, sound.to_string())! | ||
os.mkdir_all(os.dir(paths.sound)) or {} | ||
os.write_file(paths.sound, sound.to_string())! | ||
} | ||
if !os.exists(paths.icon) { | ||
path := sound.path.replace('../assets/emoji-mart.ico', paths.icon) | ||
os.mkdir_all(os.dir(path)) or {} | ||
os.write_file(path, icon.to_string())! | ||
os.mkdir_all(os.dir(paths.icon)) or {} | ||
os.write_file(paths.icon, icon.to_string())! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters