From 0fb7edecc6f7968e91ae19ef683d8ed3719b7ab0 Mon Sep 17 00:00:00 2001 From: Dale Henrichs Date: Tue, 10 Oct 2023 11:03:26 -0700 Subject: [PATCH] fix error in bin/createProjectSet.solo --- .github/workflows/ci.yml | 2 +- bin/createProjectSet.solo | 38 +++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f78f2b0..216c6fbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: export CI="true" $GSDEVKIT_STONES_ROOT/tests/test_help.sh shell: bash - - name: run projet sets + - name: run project sets run: | export GEMSTONE_ROOT=${{ steps.setup-GsDevKit_stones.outputs.gemstone-product-path }} export SUPERDOIT_ROOT=${{ steps.setup-GsDevKit_stones.outputs.superDoit-root }} diff --git a/bin/createProjectSet.solo b/bin/createProjectSet.solo index c6464577..cfce6c9a 100755 --- a/bin/createProjectSet.solo +++ b/bin/createProjectSet.solo @@ -102,33 +102,37 @@ doit name := self projectSet. self from ifNotNil: [:fromPath | - projectSet := (self globalNamed: 'GDKProjectSet') fromPath: fromPath ifAbsent: [ self error: 'No project set found at ', fromPath printString, ' (', self basename, ')' ]. + (self json isNil and: [ self json isNil]) + ifFalse: [ self error: 'Must one and only one of --from, --empty or --json options', ' (', self basename, ')' ]. + projectSet := (self globalNamed: 'GDKProjectSet') + fromPath: fromPath + ifAbsent: [ self error: 'No project set found at ', fromPath printString, ' (', self basename, ')' ]. projectSet name: name; parentRegistryName: stonesRegistry parentRegistryName; parentRegistryPath: stonesRegistry parentRegistryPath ] ifNil: [ + projectSet := (self globalNamed: 'GDKProjectSet') newNamed: name inStonesRegistry: stonesRegistry. self empty ifFalse: [ | dict | self json - ifNil: [ self error: 'Must specify one of --from, --empty or --json options', ' (', self basename, ')' ] + ifNil: [ self error: 'Must specify one and only one of --from, --empty or --json options', ' (', self basename, ')' ] ifNotNil: [:fileName | - projectSet := (self globalNamed: 'GDKProjectSet') newNamed: name inStonesRegistry: stonesRegistry. - fileName asFileReference readStreamDo: [:stream | - dict := STON fromStream: stream ]. - dict keysAndValuesDo: [:projectName :branch | - | specDict | - specDict := Dictionary new - at: 'revision' - put: branch; - at: 'gitUrls' - put: (Dictionary new - at: 'gs' - put: 'git@git.gemtalksystems.com:', projectName; - yourself); - yourself. - projectSet loadSpecs at: projectName put: specDict ] ] ] ]. + fileName asFileReference readStreamDo: [:stream | + dict := STON fromStream: stream ]. + dict keysAndValuesDo: [:projectName :branch | + | specDict | + specDict := Dictionary new + at: 'revision' + put: branch; + at: 'gitUrls' + put: (Dictionary new + at: 'gs' + put: 'git@git.gemtalksystems.com:', projectName; + yourself); + yourself. + projectSet loadSpecs at: projectName put: specDict ] ] ] ]. projectSet registryDir ensureCreateDirectory. projectSet export. stonesRegistry projectSets at: name put: projectSet registryPath.