Skip to content

Commit a21770f

Browse files
committedSep 9, 2022
[[docs]] first-pass on updating documentation to the new desktop version.
1 parent f9af729 commit a21770f

15 files changed

+200
-66
lines changed
 

‎docs/_sidebar.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- [Packages](packages/)
1111
- [Privacy Policy](privacy-policy.md)
1212
- Release Notes
13+
- [Version 2022.9.3-alpha](release_notes/2022.9.3-alpha.md)
14+
- [Version 2022.9.2-alpha](release_notes/2022.9.2-alpha.md)
1315
- [Version 2022.9.1-alpha](release_notes/2022.9.1-alpha.md)
1416
- [Version 2022.4.1](release_notes/2022.4.1.md)
1517
- [Version 2022.2.1](release_notes/2022.2.1.md)

‎docs/development/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The driving ideas behind Patchfox are:
1616
1717
The way Patchfox works is:
1818

19-
1. A core set of low-level code, which should be changed as infrequently as possible, provides features to the packages. It can be found in the `src/core` folder.
20-
2. Everything a user interacts with is provided by a package from `src/packages`.
19+
1. A core set of low-level code, which should be changed as infrequently as possible, provides features to the packages. It can be found in the `ui/core` folder.
20+
2. Everything a user interacts with is provided by a package from `ui/packages`.
2121

2222
The main avenues for contribution are:
2323

‎docs/development/app-development.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Apps are self-contained [packages](/development/packages.md). They are accessibl
55
![application launcher](d-launcher.png)
66
_Application Launcher_
77

8-
Before you can create a new mini-app, you should study the [packages documentation](/development/packages.md) and the source code for one of the included mini-apps. The [Books](https://github.com/soapdog/patchfox/tree/master/ui/packages/books) mini-app is a good place to start because it has many of the features you might want to learn how to implement.
8+
Before you can create a new mini-app, you should study the [packages documentation](/development/packages.md) and the source code for one of the included mini-apps. The [Books](https://github.com/soapdog/patchfox/tree/master/ui/packages/books) mini-app is a good place to start because it is a good example of a self-contained application with many features.
99

1010
What makes a package a mini-app is the inclusion of: `app: true` in its `patchfox.package()` declaration. This will place it on the _Launcher_.
1111

1212
## Steps to create a new mini-app
1313

14-
1. Create a folder for your mini-app under `src/packages/`. The name of the folder should match the name of the mini-app (which is also the name of the package).
14+
1. Create a folder for your mini-app under `ui/packages/`. The name of the folder should match the name of the mini-app (which is also the name of the package).
1515
2. Don't forget to include `app: true` in the `patchfox.package()` declaration.
16-
3. Create a _default view_ for your package. It should be a Svelte view. Add it with `view: myDefaultView` in the declaration. This is the view that the _Launcher_ loads when a user launches your app.
16+
3. Create a _default view_ for your package. It should be a Mithril component. Add it with `view: myDefaultView` in the declaration. This is the view that the _Launcher_ loads when a user launches the app.
1717
4. Include a nice icon. :-)
1818
5. Only packages added to `ui/packages/packages.js` will be loaded.

‎docs/development/building.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ After saving Patchfox will then try loading your public feed. You need to have a
4242
* `npm run builder:*` many different scripts to build binaries for each platform.
4343
* `npm run docs`: builds the documentation.
4444
* `npm run localbuild`: builds the CSS, the docs, and binaries for various platforms on your local machine.
45+
* `npm run release`: Makes a new release and upload it to Github.
4546

4647
# Testing the protocol schemas
4748

‎docs/development/core.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Patchfox Core
22

3-
The _core_ contains the low-level code that supports the [Patchfox packaging system](/development/packages.md). The source lives in `src/core`. The best way to understand it is to learn about how the folders are organized.
3+
The _core_ contains the low-level code that supports the [Patchfox packaging system](/development/packages.md). The source lives in `ui/core`. The best way to understand it is to learn about how the folders are organized.
44

5-
## `src/ui/core/components`
5+
## `ui/core/components`
66

77
This mess is the collection of reusable [Mithril](https://mithril.js.org) components that make up the UI for the packages.
88

@@ -14,27 +14,27 @@ Some of current reusable components are:
1414
* **GenericMsg**: This is the component used to generically render a message of an unknown type.
1515
* **MessageDropdown**: This is a "kebab" or "three-dots" menu, used by all messages to provide a list of options.
1616
* **MessageRaw**: This component renders a message in plain text. The above Dropdown component provides an option to view this component.
17-
* **MessageRenderer**: This is the jack-of-all-trades message rendering component that will select the correct _card view_ for the given _message type_. These _card views_ come from the packages inside `src/ui/packages/`.
17+
* **MessageRenderer**: This is the jack-of-all-trades message rendering component that will select the correct _card view_ for the given _message type_. These _card views_ come from the packages inside `ui/packages/`.
1818
* **QueryRepeater**: Lots of views are just a collection of messages obtained with an _SSB query_. This is a handy component to render them.
1919
* **VoteCounter**: The component to show _likes_ on a message.
2020
* **Timestamp**: Just a convenient way to render timestamps.
2121

22-
## `src/ui/kernel`
22+
## `ui/core/kernel`
2323

2424
Patchfox has a kernel that provides the `patchfox.*` API used by the packages. This should eventually get its own documentation page.
2525

2626
The kernel is responsible for the routines for preference handling, navigation, menu and event handling, and package loading.
2727

2828
You need to be doing something very deep to find yourself in this folder. Most code here has not seen any changes in years.
2929

30-
## `src/ui/platforms/nodejs-ssb`
30+
## `ui/core/platforms/nodejs-db1`
3131

3232
It's been a longtime dream of mine to support other protocols beyond SSB. To make that more feasible, I created a _platforms_ folder and placed the _ssb core_ inside it.
3333

3434
The _ssb core_ provides the `ssb.*` APIs to Patchfox. There is a lot of work to do there because it's messy, has a lot of dead code, and a ton of duplication.
3535

36-
The main idea behind this folder is to be able to support different SSB backends such as _go ssb_ and the new _db2_. This is also where IPFS and Hyper code will live once I bring them back in.
36+
This folder will also enable Patchfox to support different SSB backends such as _go ssb_ and the new _db2_. This is also where IPFS and Hyper code will live once I bring them back in.
3737

38-
## `src/ui/runtimes`
38+
## `ui/core/runtimes`
3939

4040
At the moment this is just a placeholder waiting for when I add _Lua_ and _Scheme_ to Patchfox again.

‎docs/development/packages.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Below is an excerpt from [this message](ssb:message/sha256/hYLSp_zPkvUj2f3DMk9vz
88

99
Many SSB apps are developed as monoliths with tight interdependence between their various parts and features. There is nothing wrong with that, and it's a reasonable way of developing a cohesive application. Patchfox has been through many rewrites (and it probably needs a couple more) but the current version has coalesced into something that resembles an application platform.
1010

11-
There is a [_core_](https://github.com/soapdog/patchfox/tree/master/src/core) which provides the necessary core features upon which the rest of Patchfox is built. Inside them you'll find the shared components and the platforms. Patchfox is designed in a way that makes it possible to plug in additional platforms such as Hyper or IPFS in the future.
11+
There is a [_core_](https://github.com/soapdog/patchfox/tree/master/ui/core) which provides the necessary core features upon which the rest of Patchfox is built. Inside it, you'll find the kernel, the shared components, and the platforms. Patchfox is designed in a way that makes it possible to plug in additional platforms such as Hyper or IPFS in the future.
1212

1313
These resources from `core` do not provide features for the user. All they do is create a blank slate on which miniature applications can coexist and avoid interfering with each other.
1414

@@ -20,7 +20,7 @@ Everything in Patchfox is provided by a package.
2020

2121
![Patchfox main sourcetree](d-patchfox-sourcetree.png)
2222

23-
As can be seen on the above screenshot, Patchfox's main source tree is divided between the _core_ and _packages_. A file called [`package.js`](https://github.com/soapdog/patchfox/blob/master/src/ui/packages/packages.js) dictates which packages are loaded. By changing this file, you can customize the features you need, and how the user's experience should be.
23+
As can be seen on the above screenshot, Patchfox's main source tree is divided between the _core_ and _packages_. A file called [`package.js`](https://github.com/soapdog/patchfox/blob/master/ui/packages/packages.js) dictates which packages are loaded. By changing this file, you can customize the features you need, and how the user's experience should be.
2424

2525
## Looking closer into some packages
2626

@@ -32,11 +32,11 @@ In the screenshot below, the _hub feature_ (highlighted in red) provides the _fe
3232

3333
![screenshot showing the menus from hub package](d-hub-package.png)
3434

35-
Zooming into the [hub](https://github.com/soapdog/patchfox/tree/master/src/ui/packages/hub) package folder, we can quickly see that it is providing some feed views: mentions, popular, public, thread, and channel. It also provides a `channelCard` which is a specialised view that can appear inside any feed browser. So when you're browsing SSB and see a line saying _This person subscribed to channel whatever._, that is from the `channelCard`.
35+
Zooming into the [hub](https://github.com/soapdog/patchfox/tree/master/ui/packages/hub) package folder, we can quickly see that it is providing some feed views: mentions, popular, public, thread, and channel. It also provides a `channelCard` which is a specialised view that can appear inside any feed browser. So when you're browsing SSB and see a line saying _This person subscribed to channel whatever._, that is from the `channelCard`.
3636

3737
![hub package folder screenshot](d-hub-source.png)
3838

39-
All packages have a file named after the package that holds its configuration. In the case of hub, it is called [`hub.js`](https://github.com/soapdog/patchfox/blob/master/src/packages/hub/hub.js). It will list all the views and it is also used to assemble the hub menu.
39+
All packages have a file named after the package that holds its configuration. In the case of hub, it is called [`hub.js`](https://github.com/soapdog/patchfox/blob/master/ui/packages/hub/hub.js). It will list all the views, and it is also used to assemble the hub menu.
4040

4141
A developer can completely replace that package, or turn off features, without dealing with the other packages (with the caveat that some packages will attempt to redirect the user to views from hub, but as long as your new package follows a similar API it should be OK).
4242

‎docs/packages/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ These are the packages that Patchfox is loading.
66
* [KoFiIntegration](/packages/KoFiIntegration/)
77
* [blog](/packages/blog/)
88
* [books](/packages/books/)
9-
* [calendar](/packages/calendar/)
109
* [errorHandler](/packages/errorHandler/)
10+
* [calendar](/packages/calendar/)
1111
* [contacts](/packages/contacts/)
1212
* [firstTimeSetup](/packages/firstTimeSetup/)
1313
* [githubIntegration](/packages/githubIntegration/)
@@ -23,9 +23,9 @@ These are the packages that Patchfox is loading.
2323
* [reindexingDialog](/packages/reindexingDialog/)
2424
* [search](/packages/search/)
2525
* [settings](/packages/settings/)
26-
* [settings-old](/packages/settings-old/)
2726
* [sourcehutIntegration](/packages/sourcehutIntegration/)
28-
* [statusBar](/packages/statusBar/)
2927
* [system](/packages/system/)
28+
* [statusBar](/packages/statusBar/)
3029
* [vote](/packages/vote/)
3130
* [zine](/packages/zine/)
31+
* [settings-old](/packages/settings-old/)

‎docs/release_notes/2022.9.2-alpha.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Release 2022.9.2-alpha
2+
3+
This is a complete rework of Patchfox. I've outlined the challenges and decisions regarding the future of Patchfox in [Patchfox reborn as a desktop app](https://andregarzia.com/2022/05/Patchfox-reborn-as-a-desktop-app.html).
4+
5+
Patchfox is now an Electron-based application. What you're using now is an alpha quality release.
6+
7+
# WARNINGS
8+
9+
This is an alpha version of Patchfox.
10+
11+
This version uses `db1`, it is not compatible with existing `db2` installations such as Manyverse and Perihelion.
12+
13+
Patchfox will attempt to use your current installed identity. You can choose to let Patchfox run its own server or keep using other SSB clients as a server for Patchfox. The setup dialog will ask you that. Patchfox will reindex the database if needed. This process might take a while (there is a dialog showing the progress). If you switch back from Patchfox to Patchwork, Patchwork will reindex the database to its taste.
14+
15+
Patchfox saves its configuration to `~/.ssb/patchfox.toml`, this file is sensitive, **IT HAS YOUR SECRET/KEYS IN IT**. Patchfox can use multiple identities and you can set it up so that it uses a totally different identity than the one installed in the local machine. Because of that, instead of assuming you want to use the current `~/.ssb/secret` as an identity Patchfox will ask you about it during _setup_, and store whatever keys you chose to use in its own configuration file.
16+
17+
**DO NOT SHARE THAT FILE.**
18+
19+
## Changes
20+
21+
oh boy...
22+
23+
## I SAID CHANGES
24+
25+
Okay, besides the whole _Patchfox is now a desktop app_ change, I've replaced all Svelte-based code with [Mithril](https://mithril.js.org)-based code. That means that Patchfox no longer requires a build system to transpile its source code into something a browser can understand. This makes development a lot faster and also makes it easier to reason about the code.

‎docs/release_notes/2022.9.3-alpha.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Pre-release 2022.9.3-alpha
2+
3+
## Fixes
4+
5+
* Done a first-pass on the documentation, updating it for the new codebase.
+32-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
# No Configuration
2-
3-
To use Patchfox, you need to configure it with your Secure Scuttlebutt secret and remote. The easiest way to do it is by <a href="#" id="options-trigger">going to the Add-on options page for Patchfox</a>, there you can use the button labeled <i>Select Secret</i> to browse for your `.ssb/secret` file. Your remote and keys will be acquired from that file.
4-
5-
The <i>.ssb</i> folder is a hidden folder and your system might not display it to you by default.
6-
7-
## How to show hidden files on macOS
8-
9-
* If you're running Sierra or later macOS, you can press <code>CMD + SHIFT + .</code> to toggle the display of hidden files on Finder (or on a file selection dialog). You'll be able to select the file named <code>secret</code>
10-
* If you're running an earlier version of macOS then you can press <code>CMD + OPTION + G</code> on the file selection dialog to open a <b>location sheet</b> that allows you to type in what folder do you want to open, you can then type <code>~/.ssb/</code> and confirm. You should then be directed to that folder where you'll be able to select the file named <code>secret</code>.
11-
12-
## How to show hidden files on Windows 10
13-
14-
1. Open File Explorer from the taskbar.
15-
2. Select View > Options > Change folder and search options.
16-
3. Select the View tab and, in Advanced settings, select Show hidden files, folders, and drives and OK.
17-
18-
Check <a href="https://support.microsoft.com/en-gb/help/4028316/windows-view-hidden-files-and-folders-in-windows-10">this page for more information</a>.
19-
20-
## How to show hidden files on Linux
21-
Oh my, it kinda depends on some factors but I believe that it should be viewable by default on most Linux distros. Please reach back to me with feedback on this if you're running Linux.
22-
23-
## How to fix this
24-
25-
* <a href="#" id="options-trigger">Go to the Add-on options page for Patchfox</a> and add your remote and keys.
26-
* Want a more hands-on guide on configuring and using Patchfox? Try the [Getting Started](guide.md) guide.
27-
28-
<script src="/docs/help.js">
1+
# No Configuration
2+
3+
To use Patchfox, you need to configure it with your Secure Scuttlebutt secret and remote. If this is your first time using a SSB client, don't worry Patchfox will set it all up for you. If you're already a SSB user, you'll need to tell Patchfox what identity to use.
4+
5+
Patchfox will attempt to load the default identity that is usually stored on `~/.ssb/secret`. It will show a _setup screen_ on the first-run that lets you confirm that you want to use that identity and also enable or disable the built-in server. If you don't enable the built-in server, you'll need to run your own SSB server.
6+
7+
If you went through setup already but want to change something. Quit Patchfox, delete the file `~/.ssb/patchfox.toml` — which is where Patchfox saves its data — and start the application again. The _setup dialog_ will appear.
8+
9+
The <i>.ssb</i> folder is a hidden folder and your system might not display it to you by default.
10+
11+
## How to show hidden files on macOS
12+
13+
* If you're running Sierra or later macOS, you can press <code>CMD + SHIFT + .</code> to toggle the display of hidden files on Finder (or on a file selection dialog). You'll be able to select the file named <code>secret</code>
14+
* If you're running an earlier version of macOS then you can press <code>CMD + OPTION + G</code> on the file selection dialog to open a <b>location sheet</b> that allows you to type in what folder do you want to open, you can then type <code>~/.ssb/</code> and confirm. You should then be directed to that folder where you'll be able to select the file named <code>secret</code>.
15+
16+
## How to show hidden files on Windows 10
17+
18+
1. Open File Explorer from the taskbar.
19+
2. Select View > Options > Change folder and search options.
20+
3. Select the View tab and, in Advanced settings, select Show hidden files, folders, and drives and OK.
21+
22+
Check <a href="https://support.microsoft.com/en-gb/help/4028316/windows-view-hidden-files-and-folders-in-windows-10">this page for more information</a>.
23+
24+
## How to show hidden files on Linux
25+
Oh my, it kinda depends on some factors but I believe that it should be viewable by default on most Linux distros. Please reach back to me with feedback on this if you're running Linux.
26+
27+
## How to fix this
28+
29+
* Quit the application, delete the file called `patchfox.toml` inside the `.ssb` folder inside your home folder. Start Patchfox again and go through the first-run setup process.
30+
* Want a more hands-on guide on configuring and using Patchfox? Try the [Getting Started](guide.md) guide.
31+
32+
<script src="/docs/help.js">

‎docs/troubleshooting/no-connection.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
# Can't connect to _sbot_
2-
3-
_sbot_ also known as _ssb-server_ is the server that does all the peer to peer networking in Secure Scuttlebutt. Even though we call it a server, it is just a program running on your machine. Other Secure Scuttlebutt application such as [Patchwork](https://github.com/ssbc/patchwork) or [Patchbay](https://github.com/ssbc/patchbay) start their own embedded server when they launch (unless instructed otherwise). Unfortunately, browser add-ons cannot bundle [ssb-server](https://www.npmjs.com/package/ssb-server) for it would be a security risk if all add-ons started bundling their own server.
4-
5-
Because of that, Patchfox is a _bring your own sbot_ client. You must start _sbot_ on your own. You can do it from the command line if you have the [ssb-server NPM package installed](https://www.npmjs.com/package/ssb-server) or by starting [Patchwork](https://github.com/ssbc/patchwork) or [Patchbay](https://github.com/ssbc/patchbay).
6-
7-
In the near future we'll refactor [Scuttle Shell](https://github.com/ssbc/scuttle-shell) to work with Patchfox again.
8-
9-
## Things to double check
10-
11-
* Did you filled the correct keys and remote in the <a href="#" id="options-trigger">Patchfox Add-on options page</a>?
12-
* Are you running _sbot_? Do you have another client running?
13-
* Does the identity you used in Patchfox options page matches the identity on the running _sbot_?
14-
15-
<script src="help.js">
16-
1+
# Can't connect to _sbot_
2+
3+
_sbot_ also known as _ssb-server_ is the server that does all the peer to peer networking in Secure Scuttlebutt. Even though we call it a server, it is just a program running on your machine. This part of Secure Scuttlebutt is usually not visible to the user. Applications just load this server up when they start.
4+
5+
When you run Patchfox for the first time, it displays a setup dialog that lets you select what identity to use, fill in your remote configuration, and tell Patchfox if you want it to start the server part or if you're going to run your own.
6+
7+
The default values are:
8+
9+
- Load the default identity stored in `~.ssb/secret`.
10+
- Run the built-in server.
11+
12+
These values should get you the best Patchfox experience. Running it with different values require more knowledge about SSB such as how to run a server and which remote you're going to use.
13+
14+
## Things to double check
15+
16+
* Did you filled the correct keys and remote in the first-run setup process?
17+
* Are you running _sbot_? Do you have another client running? If you have another client running at the same time, you might need to setup Patchfox so that it doesn't start its own server. Unless you really know what you're doing, you can't have two running SSB servers at the same time. So no running Patchwork and Patchfox at the same time unless you tell Patchfox not to start its server.
18+
* Does the identity you used in Patchfox setup matches the identity on the running _sbot_?
19+
20+
<script src="help.js">
21+

‎electron-builder.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ module.exports = {
120120
win: {
121121
icon: path.join(__dirname, "ui", "assets", "images", "patchfox_pixel_512.png"),
122122
publisherName: AUTHOR,
123+
target: [{target: "zip", arch: ["arm64", "x64", "ia32"]}]
123124
},
124125

125126
// nsis: {

‎package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "patchfox",
3-
"version": "2022.9.1-alpha",
3+
"version": "2022.9.3-alpha",
44
"repository": {
55
"url": "https://github.com/soapdog/patchfox"
66
},
@@ -19,7 +19,9 @@
1919
"builder:mac": "electron-builder build --config electron-builder.config.js --mac",
2020
"build": "run-s css docs",
2121
"docs": "node scripts/copy-package-docs.js",
22-
"localbuild": "run-s build builder:*"
22+
"release-script": "node scripts/make-release.js",
23+
"localbuild": "run-s build builder:*",
24+
"release": "run-s localbuild release-script"
2325
},
2426
"devDependencies": {
2527
"@fortawesome/fontawesome-free": "^6.0.0",

‎scripts/README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
All files in here are related to developing patchfox itself and are not part of the codebase of the add-on.
1+
# Scripts
2+
All files in here are related to developing patchfox itself and are not part of the codebase of the add-on.
3+
4+
5+
### `copy-package-docs.js`
6+
7+
this script picks the documentation that is bundled with each package in `ui/packages/` and place them in `docs/` while processing them further so that they have links to source-code and related materials. This script is run by the release generation task.
8+
9+
It also does some dance moves with the release notes for the current release.
10+
11+
### `make-release.js`
12+
13+
Creates a new release and upload the assets to Github. The build happens locally. Mac universal builds are not working inside Github Actions for some reason but work fine from my machine.
14+
15+
Having this all happen locally also helps avoid lock-in to GH.

‎scripts/make-release.js

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!env node
2+
3+
// SPDX-FileCopyrightText: 20022 Patchfox Authors
4+
//
5+
// SPDX-License-Identifier: CC0-1.0
6+
7+
const path = require("path")
8+
const fs = require("fs")
9+
const { spawn } = require("child_process")
10+
const rimraf = require("rimraf")
11+
const PackageJSON = require("../package.json")
12+
const version = PackageJSON.version
13+
14+
const releaseNotes = "./build/release-notes.md"
15+
16+
const windowsFiles = [
17+
`./build/Patchfox-${version}-ia32-win.zip#Patchfox for Windows (32bits)`,
18+
`./build/Patchfox-${version}-win.zip#Patchfox for Windows (64bits)`,
19+
`./build/Patchfox-${version}-arm64-win.zip#Patchfox for Windows (arm64)`,
20+
]
21+
22+
const linuxFiles = [
23+
`./build/Patchfox-${version}-universal.dmg#Patchfox for macOS (universal)`
24+
]
25+
26+
const macFiles = [
27+
`./build/Patchfox-${version}.tar.gz#Patchfox for Linux (64bits)`,
28+
`./build/Patchfox-${version}-arm64.tar.gz#Patchfox for Linux (arm64)`,
29+
]
30+
31+
const files = [
32+
...windowsFiles,
33+
...linuxFiles,
34+
...macFiles
35+
]
36+
37+
files.forEach(fileWithLabel => {
38+
let f = fileWithLabel.slice(0, fileWithLabel.indexOf("#"))
39+
if (!fs.existsSync(f)) {
40+
throw `Missing release file: '${f}'`
41+
}
42+
})
43+
44+
if (!fs.existsSync(releaseNotes)) {
45+
throw "missing release notes"
46+
}
47+
48+
const fileList = files
49+
50+
let args = [
51+
"release",
52+
`create`,
53+
`v${version}`,
54+
"-p",
55+
"--discussion-category",
56+
"General",
57+
`--title`,
58+
`Patchfox v${version} Pre-release`,
59+
`-F`,
60+
`${releaseNotes}`,
61+
...fileList
62+
]
63+
const defaults = {
64+
cwd: process.cwd(),
65+
env: process.env
66+
}
67+
const child = spawn("gh", args)
68+
69+
child.stdout.on("data", data => {
70+
console.log(`stdout:\n${data}`)
71+
})
72+
73+
child.stderr.on("data", data => {
74+
console.error(`stderr: ${data}`)
75+
})

0 commit comments

Comments
 (0)
Please sign in to comment.