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
This directory contains utilities for managing derived projects that are built on top of the Open SaaS template.
4
-
5
3
## dope.sh - Diff Or Patch Executor
6
4
7
-
The `dope.sh` script allows you to easily create a diff between two projects (base and derived), or to patch those diffs onto the base project to get the derived one. This is useful when a derived project has only small changes on top of the base project and you want to keep it in a directory in the same repo as the main project.
5
+
The `dope.sh` script allows you to easily create a diff between two projects (base and derived),
6
+
or to patch those diffs onto the base project to get the derived one. This is useful when a derived
7
+
project has only small changes on top of the base project and you want to keep it in a directory
8
+
in the same repo as the main project.
9
+
10
+
Since derived apps (like opensaas-sh) are just the Open SaaS template with some small tweaks, and
11
+
we want to keep them up to date as the template changes, we don't version the actual app code in git.
12
+
Instead, we version the diffs between it and the template in an `app_diff/` directory.
8
13
9
14
### Usage
10
15
@@ -18,27 +23,35 @@ The `dope.sh` script allows you to easily create a diff between two projects (ba
18
23
-`diff`: Creates a diff between the base and derived directories
19
24
-`patch`: Applies existing diffs onto the base directory to recreate the derived directory
20
25
21
-
### Workflow
26
+
The diffs are stored in a directory named `<DERIVED_DIR>_diff/` (e.g., `app_diff/`).
27
+
28
+
### Diff structure
22
29
23
-
Since derived apps (like opensaas-sh) are just the Open SaaS template with some small tweaks, and we want to keep them up to date as the template changes, we don't version the actual app code in git. Instead, we version the diffs between it and the template in an `app_diff/` directory.
30
+
The diff directory can contain `.diff` files to patch files from the base directory,
31
+
and `.copy` files to copy files directly from the diff directory to the derived directory
32
+
(useful for binary files).
33
+
34
+
### Workflow
24
35
25
36
The typical workflow is:
26
37
27
-
1. Run `dope.sh` with `patch` action to generate `app/` from `../template/` and `app_diff/`:
38
+
1. Run `dope.sh` with the `patch` action to generate `app/` from `../template/` and `app_diff/`:
28
39
```bash
29
40
./dope.sh ../template app patch
30
41
```
31
42
32
-
2. If there are any conflicts (normally due to updates to the template), modify `app/` until you resolve them. Make any additional changes as needed.
43
+
2. If there are any conflicts (usually due to updates to the template), modify `app/` until you resolve them. Make any additional changes as needed.
33
44
34
-
3. Generate new `app_diff/` based on the current updated `app/` by running:
45
+
3. Generate a new `app_diff/` based on the updated `app/` by running:
35
46
```bash
36
47
./dope.sh ../template app diff
37
48
```
38
49
39
-
### Running on MacOS
50
+
### Requirements
51
+
52
+
#### Running on macOS
40
53
41
-
If you're running the `dope.sh` script on Mac, you need to install:
54
+
If you're running the `dope.sh` script on macOS, install:
42
55
43
56
-`grealpath` (packaged within `coreutils`)
44
57
-`gpatch`
@@ -50,4 +63,4 @@ brew install gpatch
50
63
brew install diffutils
51
64
```
52
65
53
-
The script will automatically detect macOS and use`gpatch` instead of the default `patch` command.
66
+
The script automatically detects macOS and uses`gpatch` instead of the default `patch` command.
0 commit comments