Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit baa6866

Browse files
Merge pull request #12 from ikenna/master
Enable checking out code for particular profiles.
2 parents b8c4d7c + 02a330d commit baa6866

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/sm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _process_command():
4545
parser.add_argument('--checkports', action='store_true', help='Validates default ports for duplicates - returns code 1 if duplicates exist')
4646
parser.add_argument('--printconfig', type=str, nargs='*', help='Print the config for a given list of services, if empty, show all')
4747
parser.add_argument('-c', '--config', type=str, help='Sets the configuration directory location, defaults to $WORKSPACE/service-manager-config')
48-
parser.add_argument('--getdascode', action='store_true', help='Checkout all of the code if you haven\'t already')
48+
parser.add_argument('--getdascode', nargs='*', help='With no arguements, checks out all services if you haven\'t already. Else checks out just the specified service or profile.')
4949
parser.add_argument('--showcmdfor', type=str, nargs='*', help='Shows how sm will try start the service')
5050
parser.add_argument('-l', '--logs', type=str, help='View the logs associated with the service').completer = ServiceCompleter
5151

@@ -133,8 +133,11 @@ def _process_command():
133133
" in services: " + service_name + " and " + ports_used[service["defaultAdminPort"]])
134134
ports_used[service["defaultAdminPort"]] = service_name
135135

136-
if args.getdascode:
137-
for service_name in context.application.services:
136+
if args.getdascode is not None:
137+
services = context.application.services
138+
if len(args.getdascode) > 0:
139+
services = service_resolver.resolve_services_from_array(args.getdascode)
140+
for service_name in services:
138141
service_data = context.application.services[service_name]
139142
if "sources" in service_data and "location" in service_data and "repo" in service_data["sources"]:
140143
path = context.application.workspace + service_data["location"]

0 commit comments

Comments
 (0)