Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use any template by giving its path #78

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

T1mL3arn
Copy link

closes #77

Now it is possible to do this:

flixel tpl ../platformer-template . -n "Marevo"

which creates in . (current dir) a project with name "Marevo" from template found in ../platformer-template.

Copy link
Member

@Geokureli Geokureli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with using the templateName arg to specify the source path, and i think the doc is confusing and makes it confusing to differentiate the source path with the destination path.

could we instead leave the name as the name, and add a new arg like --sourcePath of something?

final isHaxelibRun = Sys.getEnv('HAXELIB_RUN') != null;
return new massive.sys.cmd.Console(isHaxelibRun);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This properly determines if tools are run by haxelib. During tests of this patch I run the tools directly by neko run.n, and without HAXELIB_RUN var check there is a bug when last . argument passed to the tools is ignored. See massive-oss/mlib/pull/25

@@ -79,7 +135,7 @@ class Template extends Command

if (!autoContinue)
{
answer = CommandUtils.askYN("Directory exists - do you want to delete it first?");
answer = CommandUtils.askYN("Directory exists - do you want to delete it first? Type . to abort.");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add CommandUtils.askYNAbort to be more clear?

Copy link
Author

@T1mL3arn T1mL3arn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to make command help less confusing

info/template.txt Outdated Show resolved Hide resolved
info/template.txt Outdated Show resolved Hide resolved
info/template.txt Outdated Show resolved Hide resolved
@T1mL3arn
Copy link
Author

I don't agree with using the templateName arg to specify the source path

Why not? Using the same arg as a source for the template (path or name) looks natural to me. E.g. in git we can use checkout with commit hashes and branch names.

@Geokureli
Copy link
Member

I don't agree with using the templateName arg to specify the source path

Why not? Using the same arg as a source for the template (path or name) looks natural to me. E.g. in git we can use checkout with commit hashes and branch names.

how is it natural to use an arg for a purpose completely unrelated to it's name, why not just use a new arg

@T1mL3arn
Copy link
Author

how is it natural to use an arg for a purpose completely unrelated to it's name

So, we are talking about naming here. It could be named like template-source then. Again, with git checkout it is not a problem, we can do

git checkout <branch>
git checkout <commit>

Why can't we do

flixel tpl <template-name>
flixel tpl <template-path>
# or more general
flixel tpl <template-source>

?

Also, maybe in the first place, there is no need in template-name ? ATM Flixel has only default template and no means to create other (convenient at least).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template cmd does not allow to use custom path to template
2 participants