Titanium JIRA Archive
Alloy (ALOY)

[ALOY-742] CLI: alloy generate style command does not check for the existence of the global style or files without view-controllers before overwriting it

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-12T19:12:29.000+0000
Affected Version/sAlloy 1.2.0
Fix Version/sAlloy 1.2.0, 2013 Sprint 14
ComponentsStyling, Tooling
Labelsn/a
ReporterBenjamin Hatfield
AssigneeTony Lukasavage
Created2013-07-12T18:27:43.000+0000
Updated2013-07-12T20:01:52.000+0000

Description

ENVIRONMENT: Mac OS X 10.7.5 Alloy 1.2.0 (Thu Jul 11 19:19:59/05d8ac922791043cf383d79993a4a2965325edc4) REPRODUCTION: Create a default Alloy project. Run 'alloy generate style index' twice. --> On the second attempt, you receive a warning that the file already exist. Run 'alloy generate style app' twice (or use a name with no associated view-controller) --> On the second attempt, the Alloy CLI overwrites the file with the skeleton version. EXPECTED RESULT: The command should not overwrite an existing file. {panel} savoytruffle:AlloyTestDynamicStyling bhatfield$ alloy generate -b style index [INFO] Generated style named index savoytruffle:AlloyTestDynamicStyling bhatfield$ alloy generate -b style index [WARN] Style named index already up-to-date savoytruffle:AlloyTestDynamicStyling bhatfield$ alloy generate -b style app [INFO] Generated style named app savoytruffle:AlloyTestDynamicStyling bhatfield$ alloy generate -b style app [INFO] Generated style named app {panel}

Comments

  1. Tony Lukasavage 2013-07-12

    PR: https://github.com/appcelerator/alloy/pull/177 Functional test passes by following these steps:

    create a default alloy app

    execute alloy generate style app, which should generate a default app.tss

    execute alloy generate style app again, which should now throw an error indicating that the file already exists.

    execute alloy generate style foo, which should generate a default foo.tss

    execute alloy generate style foo again, which should now throw an error indicating that the file already exists.

    Create a "app/views/foo.xml" file that contains: <Window id="bar"/>

    execute alloy generate style foo a third time, which should now update the existing foo.tss file by adding an entry for "#bar"

  2. Benjamin Hatfield 2013-07-12

    FR passed. Receiving error for files (with no view-controllers) that already exist and correctly updating styles when new id or class attributes are added to markup files.

JSON Source