Copy config files around to prevent overwriting
This commit is contained in:
parent
30fda2b0ee
commit
a9a08e656f
2
debian/.gitignore
vendored
2
debian/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
8
debian/postinst
vendored
Executable file
8
debian/postinst
vendored
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
if [ ! -f /etc/soundfx-rs/config.env ]; then
|
||||||
|
cp /etc/soundfx-rs/default.env /etc/soundfx-rs/config.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
#DEBHELPER#
|
@ -68,8 +68,8 @@ pub async fn register_application_commands(
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
if Path::new("/etc/soundfx-rs/default.env").exists() {
|
if Path::new("/etc/soundfx-rs/config.env").exists() {
|
||||||
dotenv::from_path("/etc/soundfx-rs/default.env").unwrap();
|
dotenv::from_path("/etc/soundfx-rs/config.env").unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
@ -409,14 +409,7 @@ WHERE
|
|||||||
&self,
|
&self,
|
||||||
db_pool: impl Executor<'_, Database = Database>,
|
db_pool: impl Executor<'_, Database = Database>,
|
||||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
sqlx::query!(
|
sqlx::query!("DELETE FROM sounds WHERE id = ?", self.id)
|
||||||
"
|
|
||||||
DELETE
|
|
||||||
FROM sounds
|
|
||||||
WHERE id = ?
|
|
||||||
",
|
|
||||||
self.id
|
|
||||||
)
|
|
||||||
.execute(db_pool)
|
.execute(db_pool)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user