added create plugin txt to linker
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
use std::{fs, io, os::unix, path::Path};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
basic_types::{ModdedInstance, RootConfig},
|
basic_types::{ModdedInstance, RootConfig},
|
||||||
utils::walk_files_recursive,
|
utils::walk_files_recursive,
|
||||||
};
|
};
|
||||||
|
use std::io::Write;
|
||||||
|
use std::{fs, io, os::unix, path::Path};
|
||||||
|
|
||||||
pub fn link_instance_to_target(
|
pub fn link_instance_to_target(
|
||||||
root_config: &RootConfig,
|
root_config: &RootConfig,
|
||||||
@@ -46,6 +46,21 @@ fn link_file(target: &Path, link_name: &Path) -> Result<(), io::Error> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn create_plugins_txt(
|
||||||
|
instance: &ModdedInstance,
|
||||||
|
target: impl AsRef<Path>,
|
||||||
|
) -> Result<(), io::Error> {
|
||||||
|
let mut file = fs::File::create(target.as_ref().join("plugins.txt"))?;
|
||||||
|
|
||||||
|
writeln!(file, "# Auto generated. DO NOT EDIT MANUALLY!")?;
|
||||||
|
|
||||||
|
for plugin in instance.load_order() {
|
||||||
|
writeln!(file, "*{}", plugin)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn create_symlink_for_file(target: &Path, link_name: &Path) -> io::Result<()> {
|
fn create_symlink_for_file(target: &Path, link_name: &Path) -> io::Result<()> {
|
||||||
let absolute_path = fs::canonicalize(target)?;
|
let absolute_path = fs::canonicalize(target)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user