ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Incorrect name in config.xml

Open jgw96 opened this issue 9 years ago • 4 comments

From @shaneparsons on June 9, 2017 13:14

Ionic version: (check one with "x") [ ] 1.x [ ] 2.x [x] 3.x

I'm submitting a ... [x] bug report [ ] feature request [ ] support request

Current behaviour: Creating a new project (i.e. ionic start [app-name]) will not update the name in the config.xml. It will remain as MyApp unless you intentionally remember to change it.

For a production app it will obviously be noticed at some point, but for a quick test app, it's often forgotten.

Expected behaviour: For the config.xml to have the name you give the new app by default.

Steps to reproduce:

  1. Run ionic start test
  2. Once the project is created, open up the config.xml and look at the name tag. It will be MyApp.

Ionic info:

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v8.0.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13

Copied from original issue: ionic-team/ionic#11996

jgw96 avatar Jun 09 '17 14:06 jgw96

Bit of a weird situation. We don't assume the Ionic App is a Cordova app when you do ionic start. The Cordova CLI Plugin is installed upon first invocation of ionic cordova .... But... all of our starters still have Cordova files such as config.xml. So when you run ionic start, the CLI doesn't know/care about config.xml.

Some code changes are needed in the CLI to make this happen, but you would also need to run ionic start with the --cordova flag for it to change the name during start.

imhoffd avatar Jun 09 '17 21:06 imhoffd

I see your point about the config.xml not needing to be there until you start Cordova. So the question then becomes when I do an ionic cordova prepare should that create the config.xml file? And if so, is there a way to have default to the name of the app you used when you created the Ionic project. There are some other things that would be nice to update, although not mandatory such as description, author, etc.

nelsonkd avatar Jul 31 '17 18:07 nelsonkd

Yes, precisely. It would create the file with any ionic cordova invocation if the file is missing, using default values that the Ionic CLI knows. We don't know the author, but we could use the package.json file.

imhoffd avatar Jul 31 '17 18:07 imhoffd

@shaneparsons @nelsonkd Please follow this issue: https://github.com/ionic-team/ionic-cli/issues/2595

I am condensing.

imhoffd avatar Aug 02 '17 04:08 imhoffd