Skip to content

Commit

Permalink
fix(init): dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
megatank58 committed Oct 4, 2022
1 parent 0d255f2 commit 0038f3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ setx PATH "C:\oxido;%PATH%"
### Linux

```bash
wget https://github.com/oxidite/oxup/releases/latest/download/oxup-linux.tar.gz
tar -xf oxup-linux.tar.gz
./oxup setup
wget https://github.com/oxidite/oxup/releases/latest/download/oxup-linux.tar.gz && tar -xf oxup-linux.tar.gz && ./oxup setup && rm -rf oxup-linux.tar.gz
```
#### Bash
```bash
Expand All @@ -33,9 +31,7 @@ echo '. "$HOME/.oxido/env"' >> $HOME/.zshrc
### Macos

```bash
wget https://github.com/oxidite/oxup/releases/latest/download/oxup-darwin.zip
unzip oxup-darwin.zip
./oxup setup
wget https://github.com/oxidite/oxup/releases/latest/download/oxup-darwin.zip && unzip oxup-darwin.zip && ./oxup setup && rm -rf oxup-darwin.zip
```
#### Bash
```bash
Expand Down
11 changes: 5 additions & 6 deletions src/init.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fs::{create_dir, write};
use std::fs::{create_dir_all, write};

use crate::success;

Expand All @@ -12,12 +12,11 @@ pub fn init(name: String) {
"[package]
name = {name}
version = 0.1.0
"
);
");

create_dir("src").unwrap();
write("src/main.ox", default_function).unwrap();
write("Oxup.toml", metadata).unwrap();
create_dir_all(format!("{name}/src")).unwrap();
write(format!("{name}/src/main.ox"), default_function).unwrap();
write(format!("{name}/Oxup.toml"), metadata).unwrap();

success![format!("Successfully initialised {name}!")]
}

0 comments on commit 0038f3c

Please sign in to comment.