diff --git a/scripts/arch.sh b/scripts/arch.sh new file mode 100755 index 0000000..d81f13a --- /dev/null +++ b/scripts/arch.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +PREFIX="/imperfect/repo" + +if [ ! -d "$PREFIX/arch" ]; then + printf "Creating $PREFIX/arch\n" + sudo mkdir "$PREFIX/arch" +fi + +if [ ! -d "$PREFIX/arch/tarballs" ]; then + printf "Creating $PREFIX/arch/tarballs\n" + sudo mkdir "$PREFIX/arch/tarballs" +fi diff --git a/scripts/setup.sh b/scripts/setup.sh index 388b5e9..3c65d3f 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -10,6 +10,16 @@ if [ ! -d "/imperfect/repo" ]; then sudo mkdir /imperfect/repo fi +if [ ! -d "/imperfect/repo/imperfect" ]; then + printf "Creating /imperfect/repo/imperfect\n" + sudo mkdir /imperfect/repo/imperfect +fi + +if [ ! -d "/imperfect/repo/imperfect/tarballs" ]; then + printf "Creating /imperfect/repo/imperfect/tarballs\n" + sudo mkdir /imperfect/repo/imperfect/tarballs +fi + if [ ! -d "/imperfect/etc" ]; then printf "Creating /imperfect/etc/\n" sudo mkdir /imperfect/etc diff --git a/src/main.rs b/src/main.rs index 3598c2f..f9bf6cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ fn main() -> Result<(), std::io::Error> { std::fs::write("etag", etag.as_bytes()).expect("Failed to write ETAG..."); } - let mut file = File::create("/imperfect/repo/arch/tarballs/bash.pkg.tar.xz").expect("file creation failed"); + let mut file = File::create("/imperfect/repo/arch/tarballs/bash.pkg.tar.xz").expect("file creation failed. Did you setup arch? Do you have permission?"); resp.copy_to(&mut file).expect("failed to write file"); }