[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 Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-12T19:12:29.000+0000 |
Affected Version/s | Alloy 1.2.0 |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 14 |
Components | Styling, Tooling |
Labels | n/a |
Reporter | Benjamin Hatfield |
Assignee | Tony Lukasavage |
Created | 2013-07-12T18:27:43.000+0000 |
Updated | 2013-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}
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.tssexecute
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.tssexecute
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"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.