You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-20Lines changed: 53 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,34 +30,58 @@ Current automated triggers:
30
30
- linux: `BitburnerGoFilesync`
31
31
2. Put the executable in same directory where you keep all your bitburner scripts
32
32
3. Open a commandline in the directory you put the executable in
33
-
4. Move on to **Usage**
33
+
4. Move on to [Usage](#usage)
34
34
35
-
You may skip step 2 and put the executable anywhere you like, but for the program to work you will then have to supply it with a `--dir` argument flag, more about that in **Arguments**.
35
+
You may skip step 2 and put the executable anywhere you like, but for the program target the correct files,
36
+
<br>you may need to specify youre preferred file path in the [config](#config),
37
+
<br>or pass in the `--dir` argument, more about that in [Arguments](#arguments).
36
38
37
-
Alternatively if you rather not download an executable from this repository (I would not blame you for being careful) you may also clone this repository and build it yourself:
39
+
Alternatively if you rather not download an executable from this repository (I would not blame you for being careful)
40
+
you may also clone this repository and [run/build it yourself](#how-to-build).
38
41
39
-
## How to build
42
+
## Usage
40
43
41
-
### Requirements
42
-
-[golang](https://go.dev/doc/install): To be able to run the code
44
+
Once the executable is installed you are ready to get started with the game, the only thing you would still need to do is start the filesyncer via the commandline that you should have opened in step 3 of the installation guide.
43
45
44
-
Once you have a clone of this repository and you installed the *long list* of requirements you may run the project in any of the following ways:
45
-
-`make run`: This will run the project without any arguments.<br>
46
-
This method __does not__ accept arguments.
47
-
-`go run main.go`: This is what `make run` would have done for you.<br>
48
-
This method __does accept__ arguments.
49
-
-`make build`: This will compile the project into a binary.<br>
50
-
The binary will be located relative to the working directory of this project (where the main.go is) at `./build/`.
46
+
Simply enter `BitburnerGoFilesync.exe` (or whatever the executable is called on your system) and pass in any arguments that you like to run it with.
51
47
52
-
For more run methods you can check out the `./Makefile` and try any of its commands under `-- Project --`.
48
+
## Config
53
49
50
+
A config file will be created for you once you run the tool for the first time.
54
51
55
-
## Usage
52
+
The file will be located in the same directory that you ran the tool in, you can change that with the `--config` argument (use `--help config` for more info).
56
53
57
-
Once the executable is installed you are ready to get started with the game, the only thing you would still need to do is start the filesyncer via the commandline that you should have opened in step 3 of the installation guide.
54
+
The config file by default will be named `config.toml` and the initial content will be all possible fields for the config with their default values assigned to them.
55
+
56
+
### Config Fields
58
57
59
-
Simply enter `BitburnerGoFilesync.exe` (or whatever the executable is called on your system) and pass in any arguments that you like.
58
+
**Legend**:
59
+
-`[field]`: Group Section Header. This row's default column will instead be empty or hold relevant info.
60
+
-`- field`: Section child field.
60
61
62
+
| Field | Description | Default |
63
+
|:-----|:------------|:-------:|
64
+
| Port | Set the port for the server to connect to. |`"8080"`|
65
+
| Directory | Specify the directory where this tool should watch for file changes to sync up with bitburner. |`"./"`|
66
+
| FileScanInterval | The amount of miliseconds the file scanner waits each loop. |`100`|
67
+
|[FilePatterns]| Holds include and exclude file pattern matching fields which allow you to define which files to sync and which not to. |[Pattern matching rules](https://github.com/bmatcuk/doublestar?tab=readme-ov-file#patterns)|
68
+
| - Include | Which files should be included. |`["**/*.js", "**/*.ts"]`|
69
+
| - Exclude | Which files to ignore. This is checked before the include patterns. |`["**/*.d.ts"]`|
70
+
71
+
## How to build
72
+
73
+
### Requirements
74
+
-[golang](https://go.dev/doc/install): To be able to run the project.
75
+
- (Optional) [wgo](https://github.com/bokwoon95/wgo): This is required for some Makefile targets.
76
+
<br>It is a tool that also watches the project for file changes and restarts it once anything is detected.
77
+
78
+
Once you have a clone of this repository and you installed the "*long list*" of requirements you can run the project in one of two ways:
79
+
1. Use `make [target]`.
80
+
<br>To see all possible targets and their descriptions, run `make help`.
81
+
2. Manually type out what you want to run.
82
+
<br>This would be something along the lines of `go run . --arg1 param --arg2 ...`.
83
+
84
+
If you are looking to contribute, please read the [Contribution Guidelines](https://github.com/CTNOriginals/BitburnerGoFilesync?tab=readme-ov-file).
61
85
62
86
## Arguments
63
87
@@ -67,11 +91,11 @@ Formatting Rules:
67
91
Each new argument always has to start with a double dash '--'.
68
92
If the argument does not start with '--' it is considered a parameter
69
93
for the most recent argument that started with '--'.
70
-
94
+
71
95
Each argument may have any number of parameters,
72
96
to check what an argument may accept or require,
73
97
you can do --help followed by the name of the argument without the '--'.
74
-
98
+
75
99
Some arguments may accept a specific amount of parameters where others accept a range.
76
100
If an argument doesnt have its required parameters, it will say so in the console,
77
101
this argument will not execute anything after that and will be ignored.
@@ -90,6 +114,15 @@ Formatting Rules:
90
114
The same as --help, but it also includes all of the extra information
91
115
as if you entered --help <command> for each argument.
92
116
117
+
--config:
118
+
Define the config.toml file path.
119
+
By default, the config file is located in the same directory as the binary.
120
+
If no config file exists at the specified location, one will be created.
0 commit comments