Skip to content

Commit 020c7f9

Browse files
authored
Merge pull request #61 from aboutcode-org/add-cli-entrypoint
Add `fedcode` command line entrypoint
2 parents 57d2973 + b09c31c commit 020c7f9

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

federatedcode/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
3+
# FederatedCode is a trademark of nexB Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/federatedcode for support or download.
7+
# See https://aboutcode.org for more information about AboutCode.org OSS projects.
8+
#
9+
10+
import os
11+
import sys
12+
13+
__version__ = "0.1.0"
14+
15+
16+
def command_line():
17+
"""Command line entry point."""
18+
from django.core.management import execute_from_command_line
19+
20+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "federatedcode.settings")
21+
execute_from_command_line(sys.argv)

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ docs =
105105
sphinxcontrib_django
106106
sphinx-jsonschema
107107

108+
[options.entry_points]
109+
console_scripts =
110+
fedcode = federatedcode:command_line
111+
108112
[isort]
109113
force_single_line = True
110114
line_length = 88

0 commit comments

Comments
 (0)