5 Commits

Author SHA1 Message Date
88b75e3e62 Add additional codes, 4601 & 6594
All checks were successful
Generate Release / validate_and_release (push) Successful in 4s
2026-04-02 11:20:50 +01:00
a241b992ac Add future considerations
All checks were successful
Generate Release / validate_and_release (push) Successful in 6s
2026-03-19 06:35:11 +00:00
5722e5b631 Update README.md
All checks were successful
Generate Release / validate_and_release (push) Successful in 7s
2026-03-18 19:24:05 +00:00
eac8d71613 Force new PIS Generation
All checks were successful
Generate Release / validate_and_release (push) Successful in 8s
2026-03-02 23:07:36 +00:00
f08a579246 Add semi-colons to match personal code style
All checks were successful
Generate Release / validate_and_release (push) Successful in 8s
2026-02-21 19:43:17 +00:00
4 changed files with 37 additions and 12 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
node_modules
package-lock.json
package-lock.json

View File

@@ -2,4 +2,25 @@
APIS Codes for GWR Class 150, 158 & 16x units
Re-initialised in a new repository on 04/12/2025. This decision was made to keep one data type, in one repository to maintain separation of data-ingress services in preparation for the 2026 data-ingress project.
Re-initialised in a new repository on 04/12/2025. This decision was made to keep one data type, in one repository to maintain separation of data-ingress services in preparation for the 2026 data-ingress project.
Data is prepared for the data-ingress service using Gitea actions, any changes made to the actions require care to ensure it doesn't break the ingress of data to OwlBoard.
## Making Changes
Updates should be made in a branch following the naming pattern:
```
branches:
- auto-*
- pis-*
```
Updated should be placed in to a new file in the /pis/ directory.
Code deletions must be made in the 'main' branch.
## Future Considerations
Adding traction type field to cover 80x generic headcodes, and whatever 175's use if not the same as other units.

View File

@@ -1,4 +1,8 @@
pis:
- code: "4601"
stops: [cdf,nwp,stj,fit,bri,bth,boa,tro,wsb,wmn,sal,rom,sou,frm]
- code: "6594"
stops: [gcr,yae,bpw,fit,asd,srd,lwh,bri]
- code: "0106"
stops: [slo,wnc]
toc: "gw"

View File

@@ -1,7 +1,7 @@
const fs = require('fs')
const yaml = require('yaml')
const fs = require('fs');
const yaml = require('yaml');
const directoryPath = './pis/'
const directoryPath = './pis/';
function sortAndMergeYAMLFiles() {
try {
@@ -12,15 +12,15 @@ function sortAndMergeYAMLFiles() {
files.forEach(file => {
const data = fs.readFileSync(directoryPath + file, 'utf-8');
const parsedData = yaml.parse(data)
const parsedData = yaml.parse(data);
if (parsedData && typeof parsedData === 'object' && parsedData.pis) {
mergedData.push(...parsedData.pis)
mergedData.push(...parsedData.pis);
} else {
if (Array.isArray(parsedData)) {
mergedData.push(...parsedData);
} else {
console.error("Incorrect YAML")
console.error("Incorrect YAML");
}
}
});
@@ -29,7 +29,7 @@ function sortAndMergeYAMLFiles() {
const codeA = parseInt(a.code);
const codeB = parseInt(b.code);
return codeA - codeB
})
});
@@ -46,9 +46,9 @@ function sortAndMergeYAMLFiles() {
try {
fs.writeFileSync('./pis/codes.yaml', outputString);
console.log("Overwritten codes.yaml")
console.log("Overwritten codes.yaml");
} catch (err) {
console.error("Error writing codes.yaml", err)
console.error("Error writing codes.yaml", err);
}
// Remove any new files
@@ -60,7 +60,7 @@ function sortAndMergeYAMLFiles() {
});
} catch(err) {
console.error('Error merging YAML:', err)
console.error('Error merging YAML:', err);
}
}