developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 9 years ago

Closed 9 years ago

#1342 closed bug (fixed)

~/.jelix-scripts.ini not (entirely) used when creating a new app

Reported by: foxmask Owned by: foxmask
Priority: normal Milestone: Jelix 1.3 beta 1
Component: jelix-scripts Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

when creating a new app by

php createapp.php ~/foobar

all the ~/.jelix-scripts.ini is not used

it's the case for newApp* properties

Attachments (1)

ticket1342.diff (1.6 KB) - added by foxmask 9 years ago.
Patch for handling the entire jelix-scripts.ini

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by foxmask

the result can by seen if the project.xml file.

this seems to come from the createFile() function from JelixScriptCommand? class

comment:2 Changed 9 years ago by foxmask

it seems the fix to do is in commands-single/createapp.cmd.php

line 121 we should have :

$param['default_id'] = $appName.$this->config->infoIDSuffix;

instead of

$param['default_id'] = $appName.$this->config->newAppInfoIDSuffix;

line 155 we should have :

   protected function createFile($filename, $template, $tplparam=array()) {
      $defaultparams = array (
         'default_website'       => $this->config->newAppInfoWebsite,
         'default_license'       => $this->config->newAppInfoLicence,
         'default_license_url'   => $this->config->newAppInfoLicenceUrl,

comment:3 Changed 9 years ago by foxmask

  • Owner set to foxmask

comment:4 follow-up: Changed 9 years ago by laurentj

  • Component changed from jelix to jelix-scripts

line 121 we should have .. instead of..

I think you want to say the contrary.. ;-)

line 155 we should have :

no, because the command calls it-self some other commands, so we won't have newapp* values in files created by these "sub-commands".

We should map newapp* values to info* variables. Perhaps the shortest way to do it is to call $this->config->loadFromProject(); after the creation of the project.xml file.

comment:5 Changed 9 years ago by foxmask

whatever we do after the creation of the project.xml file, it's too late for it to use the correct datas, isnt it ?

comment:6 in reply to: ↑ 4 Changed 9 years ago by foxmask

Replying to laurentj:

line 121 we should have .. instead of..

I think you want to say the contrary.. ;-)

true :)

comment:7 Changed 9 years ago by laurentj

yes, you're right. so we should copy newApp* values into info* properties... In fact, I forgot to use these newApp* properties...

Changed 9 years ago by foxmask

Patch for handling the entire jelix-scripts.ini

comment:8 Changed 9 years ago by foxmask

  • review set to review?

I could not pull the trunk in my clone :/

C:\WEB\SOURCES\bitbucket\jelix\jelix-trunk-my-patch>hg pull -u ssh://hg@bitbucket.org/jelix/jelix-trunk
pulling from ssh://hg@bitbucket.org/jelix/jelix-trunk
searching for changes
abort: repository is unrelated

So i made a classic patch.

Can you check if it's ok for you ?

comment:9 follow-up: Changed 9 years ago by Mindiell

I think you forgot some fields in your patch. I found those : $this->config->infoLocale $this->config->infoCopyright $this->config->infoCreatorName $this->config->infoCreatorMail

They are not part of your patch

comment:10 in reply to: ↑ 9 Changed 9 years ago by foxmask

Replying to Mindiell:

I think you forgot some fields in your patch. I found those : $this->config->infoLocale $this->config->infoCopyright $this->config->infoCreatorName $this->config->infoCreatorMail

They are not part of your patch

You can make a try and see the result of project.xml / module.xml in your app

you'ill see that those 4 var are ok in those files.

comment:11 Changed 9 years ago by laurentj

  • Resolution set to fixed
  • review changed from review? to review+
  • Status changed from new to closed

Mindiell is right: infoCopyright and infoLocale should be initialized. Others no, because the creator is always you.

I modified a little the patch and pushed it: https://bitbucket.org/jelix/jelix-trunk/changeset/c224035f195e

Note: See TracTickets for help on using tickets.