Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Add '--wwwroot' and '--wwwroot-out' option to "kpm pack" #622

Merged
merged 1 commit into from
Sep 12, 2014

Conversation

ChengTian
Copy link
Contributor

  • '--wwwroot' specifies the name of public folder in project dir
  • '--wwwroot-out' specifies the name of public folder in packed image
  • '--appfolder' is replaced by '--wwwroot-out'
  • If '--wwwroot-out' is not specified, the packed image doesn't contain a public
    folder

parent #543
Also implement part of #541 , that is, if --wwwroot-out doesn't have a value, we don't create public folder in packed image.

if (!string.IsNullOrEmpty(_options.WWWRoot) &&
!Directory.Exists(Path.Combine(project.ProjectDirectory, _options.WWWRoot)))
{
Console.WriteLine("The specified wwwroot folder '{0}' doesn't exist in project directory.",
Copy link
Member

Choose a reason for hiding this comment

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

in project --> in the project

@Eilon
Copy link
Member

Eilon commented Sep 11, 2014

Not really familiar with the feature, so I just did a grammar check 😄 Need @davidfowl for an actual review.

var appFolderIniFilePath = Path.Combine(appFolderPath, "k.ini");
var appBaseLine = string.Format("KRE_APPBASE={0}",
var wwwRootOutIniFilePath = Path.Combine(wwwRootOutPath, "k.ini");
var appBaseLine = string.Format("APP_BASE={0}",
Copy link
Member

Choose a reason for hiding this comment

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

This was change to KRE_APPBASE in a recent commit. Changing this will regresses the behavior...

@ChengTian
Copy link
Contributor Author

@davidfowl @Eilon , thanks for the feedbacks. I fixed them in the latest commit.

@Eilon
Copy link
Member

Eilon commented Sep 11, 2014

The stuff from my feedback looks good. @davidfowl will have to comment on the feature itself.

@ChengTian
Copy link
Contributor Author

@davidfowl , added interaction between kpm pack and webroot property of project.json. So #541 is done in this PR, too.

{
var targetProjectJson = Path.Combine(TargetPath, Runtime.Project.ProjectFileName);
var jsonObj = JObject.Parse(File.ReadAllText(targetProjectJson));
jsonObj["webroot"] = WwwRoot;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this match the wwwrootout? It should be a relative path from the project.json to the new wwwroot folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I misunderstood the requirements. Fixed in the latest commit.

@davidfowl
Copy link
Member

:shipit:

- '--wwwroot' specifies the name of public folder in project dir
- '--wwwroot-out' specifies the name of public folder in packed image
- '--appfolder' is replaced by '--wwwroot-out'
- If '--wwwroot-out' is not specified, the packed image doesn't contain a public
  folder
- If 'webroot' property is specified, use it as default value of
  '--wwwroot'
- "kpm pack" updates 'webroot' of project.json in the packed image
@ChengTian ChengTian merged commit 5cca757 into dev Sep 12, 2014
@ChengTian ChengTian deleted the add-wwwroot-option-to-kpm-pack branch September 12, 2014 16:22
@davidfowl
Copy link
Member

/cc @troydai @vijayrkn @Praburaj

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

Successfully merging this pull request may close these issues.

None yet

3 participants