Skip to content

Commit

Permalink
submodule changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro100 committed May 29, 2024
1 parent f63026a commit a9769b9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish_validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v2
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ functions/*.zip

.env

# schemas

gbfs-validator/versions/schemas/.*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This tool is built using the [JSON Schemas](https://github.com/MobilityData/gbfs

![interface](https://github.com/MobilityData/gbfs-validator/assets/2423604/11206e7a-dd64-4133-bb32-eaa391815e60)

The schemas in `gbfs-validator/versions/schemas` is a git subtree of https://github.com/MobilityData/gbfs-json-schema. For more details, see [`gbfs-validator/versions/schemas/README.md`](https://github.com/MobilityData/gbfs-validator/tree/master/gbfs-validator/versions).
The schemas in `gbfs-validator/versions/gbfs-json-schema` is a git submodule of https://github.com/MobilityData/gbfs-json-schema.

Questions? Please open an issue or reach out on the #gbfs channel on the [MobilityData Slack](https://mobilitydata-io.slack.com/).

Expand Down
2 changes: 1 addition & 1 deletion gbfs-validator/gbfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class GBFS {
let schema

try {
schema = require(`./versions/schemas/v${version}/${file}`)
schema = require(`./versions/gbfs-json-schema/v${version}/${file}`)
} catch (e) {
console.log(e)
throw new Error('can not require')
Expand Down
4 changes: 2 additions & 2 deletions gbfs-validator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gbfs-validator",
"version": "1.0.9",
"version": "1.0.10",
"author": "MobilityData",
"main": "index.js",
"license": "MIT",
Expand All @@ -19,7 +19,7 @@
"gbfs-validator": "./cli.js"
},
"scripts": {
"test": "jest"
"postinstall": "git submodule update --init --recursive"
},
"dependencies": {
"ajv": "^8.9.0",
Expand Down
14 changes: 5 additions & 9 deletions gbfs-validator/versions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ This folder contains json schemas from `MobilityData/gbfs-json-schema` and addit

## JSON schemas

The `schemas` folder contains a [git subtree](https://www.atlassian.com/git/tutorials/git-subtree) of https://github.com/MobilityData/gbfs-json-schema.
The `schemas` folder contains a [git submodule](https://www.atlassian.com/git/tutorials/git-submodule) of https://github.com/MobilityData/gbfs-json-schema.

You can pull schema update by using the command `git subtree pull --prefix gbfs-validator/versions/schemas https://github.com/MobilityData/gbfs-json-schema.git master --squash`
You can pull schema update by using the command `git submodule update --init --recursive`

### Contributing back
## gbfs-json-schema

If you want to push a contribution to the schemas sub-project (`MobilityData/gbfs-json-schema`), you can use the command
This directory is a git submodule, making changes in this directory is not recommended

```
git subtree push --prefix=gbfs-validator/versions/schemas/ https://github.com/MobilityData/gbfs-json-schema.git BRANCH
```
If you would like to make changes to `gbfs-json-schema` it is recommended to make a pull request from the original repository [gbfs-json-schema](https://github.com/MobilityData/gbfs-json-schema)

:warning: You probably don't have write access on `MobilityData/gbfs-json-schema`.
Please, fork it before and replace the repository url with your forked repository url.

0 comments on commit a9769b9

Please sign in to comment.