diff --git a/README.md b/README.md index fe8a795..8ea1962 100644 --- a/README.md +++ b/README.md @@ -121,4 +121,8 @@ nxstart -n "My new project" -a "John Doe" libnx --clion Or if you don't use CLion: ```bash nxstart -n "My new project" -a "John Doe" libnx --no-clion -``` \ No newline at end of file +``` + +## Running tests +Tests can be run with the `pytest` command. If you are contributing code, make sure all tests are green before +submitting a PR. \ No newline at end of file diff --git a/README.rst b/README.rst index 729f207..2980ba1 100644 --- a/README.rst +++ b/README.rst @@ -128,3 +128,7 @@ Or if you don't use CLion: $ nxstart -n "My new project" -a "John Doe" libnx --no-clion +Running tests +============= +Tests can be run with the `pytest` command. If you are contributing code, make sure all tests are green before +submitting a PR. \ No newline at end of file diff --git a/nxstart/cli.py b/nxstart/cli.py index bd2eb07..6a9597c 100644 --- a/nxstart/cli.py +++ b/nxstart/cli.py @@ -7,11 +7,12 @@ import click from nxstart import app +from nxstart.version import __version__ as version class Context(object): """ - Context to be passed to the subcommands. + Context to be passed to the sub-commands. """ def __init__(self): @@ -24,11 +25,24 @@ def __init__(self): @click.group() -@click.option('--name', '-n', default=None, prompt='Project name', help='The name of your project') -@click.option('--author', '-a', default=None, prompt='Author name', - help='The full name of the author') +@click.option('--name', '-n', default=None, help='The name of your project') +@click.option('--author', '-a', default=None, help='The full name of the author') @pass_context def cli(ctx, name, author): + click.echo(""" + + # # # # #### ##### ## ##### ##### + ## # # # # # # # # # # + # # # ## ##### #### # # # # # # + # # # ## # # ###### ##### # + # ## # # # # # # # # # # + # # # # #### # # # # # # + """) + click.echo('v%s - by roedesh ' % version) + if not name: + name = click.prompt('Please enter the name of your project', type=str) + if not author: + author = click.prompt('Please enter your name', type=str) ctx.name = name ctx.author = author diff --git a/nxstart/filebuilder/libt.py b/nxstart/filebuilder/libt.py index abffe12..e106873 100644 --- a/nxstart/filebuilder/libt.py +++ b/nxstart/filebuilder/libt.py @@ -14,7 +14,6 @@ def create_libt_project(folder_path, name, author): Copies the files from templates/base to folder_path and modifies Makefile and source/main.cpp to include the project name, author name and current date. - :param folder_name: Created folder name :param folder_path: Path to copy the files to :param name: Name of the project :param author: Name of the author diff --git a/nxstart/templates/brewjs/index.js b/nxstart/templates/brewjs/index.js index b03cce1..33a9f21 100644 --- a/nxstart/templates/brewjs/index.js +++ b/nxstart/templates/brewjs/index.js @@ -15,19 +15,19 @@ text.show(); // Main loop game.mainLoop(function () { - // We check pressed input. - var key = input.checkPressed(); - // We get current X and Y values of our text. - if (key === input.A) { - // We create a random color and set it to the text. - var r = device.randomNumber(0, 255); - var g = device.randomNumber(0, 255); - var b = device.randomNumber(0, 255); - var color = {R: r, G: g, B: b}; - text.color(color); - } - // If + is pressed, the main loop ends. - else if (key === input.Plus) game.exitLoop(); + // We check pressed input. + var key = input.checkPressed(); + // We get current X and Y values of our text. + if (key === input.A) { + // We create a random color and set it to the text. + var r = device.randomNumber(0, 255); + var g = device.randomNumber(0, 255); + var b = device.randomNumber(0, 255); + var color = {R: r, G: g, B: b}; + text.color(color); + } + // If + is pressed, the main loop ends. + else if (key === input.Plus) game.exitLoop(); }); // Execution ends diff --git a/nxstart/templates/libnx/.gitignore b/nxstart/templates/libnx/.gitignore index d99efa9..96bdcc6 100644 --- a/nxstart/templates/libnx/.gitignore +++ b/nxstart/templates/libnx/.gitignore @@ -29,4 +29,5 @@ # Executables *.exe *.out -*.app \ No newline at end of file +*.app +*.nro diff --git a/nxstart/templates/libt/.gitignore b/nxstart/templates/libt/.gitignore index dab799c..ce580b5 100644 --- a/nxstart/templates/libt/.gitignore +++ b/nxstart/templates/libt/.gitignore @@ -35,6 +35,7 @@ *.i*86 *.x86_64 *.hex +*.nro # Debug files *.dSYM/ diff --git a/nxstart/templates/libt/CMakeLists.txt b/nxstart/templates/libt/CMakeLists.txt index dda8504..355daeb 100644 --- a/nxstart/templates/libt/CMakeLists.txt +++ b/nxstart/templates/libt/CMakeLists.txt @@ -5,11 +5,7 @@ set(CMAKE_CXX_STANDARD 11) include_directories($ENV{LIBTRANSISTOR_HOME}/lib) include_directories($ENV{LIBTRANSISTOR_HOME}/include) -include_directories($ENV{DEVKITPRO}/libnx/lib) -include_directories($ENV{DEVKITPRO}/libnx/include) -include_directories($ENV{DEVKITARM}) -link_directories($ENV{DEVKITPRO}/libnx/lib) -link_directories($ENV{DEVKITPRO}/libnx/include) -link_directories($ENV{LIBTRANSISTOR_HOME}/bin) +link_directories($ENV{LIBTRANSISTOR_HOME}/lib) link_directories($ENV{LIBTRANSISTOR_HOME}/include) + add_executable(FOLDER_NAME_PLACEHOLDER source/main.cpp) diff --git a/nxstart/tests/test_utils_files.py b/nxstart/tests/test_utils_files.py index 32ca0a8..f73b3ba 100644 --- a/nxstart/tests/test_utils_files.py +++ b/nxstart/tests/test_utils_files.py @@ -29,4 +29,3 @@ def test_replace_in_file(tmpdir): 'TEXT_PLACEHOLDER': 'NEW_TEXT', }) assert_file_contains_strings(new_test_file_path, ['NEW_TEXT']) - diff --git a/nxstart/utils/files.py b/nxstart/utils/files.py index 50b843e..cdececf 100644 --- a/nxstart/utils/files.py +++ b/nxstart/utils/files.py @@ -2,9 +2,8 @@ """Includes functions for working with the filesystem.""" -from os.path import join, dirname - import os +from os.path import join, dirname import click @@ -50,6 +49,3 @@ def check_and_create_directory(folder_path): raise click.Abort() os.makedirs(folder_path) - - - diff --git a/nxstart/version.py b/nxstart/version.py index a6221b3..3f6fab6 100644 --- a/nxstart/version.py +++ b/nxstart/version.py @@ -1 +1 @@ -__version__ = '1.0.2' +__version__ = '1.0.3' diff --git a/setup.py b/setup.py index 0131071..25450c9 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,15 @@ def readme(): 'Source': 'https://github.com/roedesh/nxstart', }, classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Topic :: Software Development :: Code Generators', + 'Topic :: Utilities' ], )