Skip to content

Commit 1a2f696

Browse files
authored
Fix error in "update extension list" workflow (#665)
* Update update_extension_list.yml * Update nwbInstallExtension function template * whitespace
1 parent 30bf24d commit 1a2f696

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/workflows/update_extension_list.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
update_extension_list:
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: Install MATLAB
19+
uses: matlab-actions/setup-matlab@v2
20+
1821
# Use deploy key to push back to protected branch
1922
- name: Checkout repository using deploy key
2023
uses: actions/checkout@v4
2124
with:
2225
ref: refs/heads/main
2326
ssh-key: ${{ secrets.DEPLOY_KEY }}
2427

25-
- name: Install MATLAB
26-
uses: matlab-actions/setup-matlab@v2
27-
2828
- name: Update extension list in nwbInstallExtensions
2929
uses: matlab-actions/run-command@v2
3030
with:
@@ -37,7 +37,6 @@ jobs:
3737
set -e # Exit script on error
3838
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
3939
git config user.email "<>"
40-
git pull --rebase # Ensure the branch is up-to-date
4140
4241
if [[ -n $(git status --porcelain nwbInstallExtension.m) ]]; then
4342
git add nwbInstallExtension.m
@@ -46,4 +45,4 @@ jobs:
4645
else
4746
echo "Nothing to commit"
4847
fi
49-
48+

resources/function_templates/nwbInstallExtension.txt

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
function nwbInstallExtension(extensionNames, options)
2-
% nwbInstallExtension - Installs a specified NWB extension.
2+
% NWBINSTALLEXTENSION - Installs a specified NWB extension.
33
%
4-
% Usage:
5-
% nwbInstallExtension(extensionNames) installs Neurodata Without Borders
6-
% (NWB) extensions to extend the functionality of the core NWB schemas.
7-
% extensionNames is a scalar string or a string array, containing the name
8-
% of one or more extensions from the Neurodata Extensions Catalog
4+
% Syntax:
5+
% NWBINSTALLEXTENSION(extensionNames) installs Neurodata Without Borders
6+
% (NWB) extensions to extend the functionality of the core NWB schemas.
7+
% extensionNames is a scalar string or a string array, containing the name
8+
% of one or more extensions from the Neurodata Extensions Catalog
99
%
1010
% Valid Extension Names (from https://nwb-extensions.github.io):
1111
{{extensionNamesDoc}}
1212
%
13-
% Example:
14-
% % Install the "ndx-miniscope" extension
15-
% nwbInstallExtension("ndx-miniscope")
13+
% Usage:
14+
% Example 1 - Install "ndx-miniscope" extension::
15+
%
16+
% nwbInstallExtension("ndx-miniscope")
1617
%
1718
% See also:
1819
% matnwb.extension.listExtensions, matnwb.extension.installExtension
@@ -27,7 +28,8 @@ function nwbInstallExtension(extensionNames, options)
2728
if isempty(extensionNames)
2829
T = matnwb.extension.listExtensions();
2930
extensionList = join( compose(" %s", [T.name]), newline );
30-
error("Please specify the name of an extension. Available extensions:\n\n%s\n", extensionList)
31+
error('NWB:InstallExtension:MissingArgument', ...
32+
'Please specify the name of an extension. Available extensions:\n\n%s\n', extensionList)
3133
else
3234
for extensionName = extensionNames
3335
matnwb.extension.installExtension(extensionName, 'savedir', options.savedir)

tools/maintenance/matnwb_createNwbInstallExtension.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ function matnwb_createNwbInstallExtension()
1818
extensionNamesStr = compose("%s""%s""", indentStr, extensionNames);
1919
extensionNamesStr = strjoin(extensionNamesStr, ", ..." + newline);
2020
fcnStr = replace(fcnTemplate, "{{extensionNames}}", extensionNamesStr);
21-
21+
2222
extensionNamesStr = compose("%% - ""%s""", extensionNames);
2323
extensionNamesStr = strjoin(extensionNamesStr, newline);
2424
fcnStr = replace(fcnStr, "{{extensionNamesDoc}}", extensionNamesStr);
2525

26-
2726
fid = fopen(fullfile(matnwbRootDir, 'nwbInstallExtension.m'), "wt");
2827
fwrite(fid, fcnStr);
2928
fclose(fid);

0 commit comments

Comments
 (0)