solara 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/solara/lib/.DS_Store +0 -0
  3. data/solara/lib/core/.DS_Store +0 -0
  4. data/solara/lib/core/brands/brand_switcher.rb +58 -1
  5. data/solara/lib/core/dashboard/brand/BrandDetail.js +34 -2
  6. data/solara/lib/core/dashboard/brand/BrandDetailController.js +23 -233
  7. data/solara/lib/core/dashboard/brand/BrandDetailModel.js +13 -5
  8. data/solara/lib/core/dashboard/brand/BrandDetailView.js +16 -200
  9. data/solara/lib/core/dashboard/brand/SectionsFormManager.js +232 -0
  10. data/solara/lib/core/dashboard/brand/brand.html +187 -177
  11. data/solara/lib/core/dashboard/brand/source/BrandLocalSource.js +2 -5
  12. data/solara/lib/core/dashboard/brand/source/BrandRemoteSource.js +36 -133
  13. data/solara/lib/core/dashboard/brands/Brands.js +31 -0
  14. data/solara/lib/core/dashboard/brands/BrandsController.js +0 -5
  15. data/solara/lib/core/dashboard/brands/BrandsView.js +2 -2
  16. data/solara/lib/core/dashboard/brands/brands.html +71 -52
  17. data/solara/lib/core/dashboard/component/AliasesBottomSheet.js +6 -6
  18. data/solara/lib/core/dashboard/component/BrandOptionsBottomSheet.js +4 -4
  19. data/solara/lib/core/dashboard/component/ConfirmationDialog.js +15 -10
  20. data/solara/lib/core/dashboard/component/EditJsonSheet.js +160 -0
  21. data/solara/lib/core/dashboard/component/MessageBottomSheet.js +5 -5
  22. data/solara/lib/core/dashboard/component/OnboardBrandBottomSheet.js +5 -3
  23. data/solara/lib/core/dashboard/handler/base_handler.rb +1 -0
  24. data/solara/lib/core/dashboard/handler/edit_section_handler.rb +1 -5
  25. data/solara/lib/core/doctor/schema/brand_configurations.json +0 -8
  26. data/solara/lib/core/doctor/schema/platform/global/resources_manifest.json +30 -0
  27. data/solara/lib/core/doctor/schema/platform/json_manifest.json +57 -0
  28. data/solara/lib/core/doctor/validator/template/android_template_validation_config.yml +35 -1
  29. data/solara/lib/core/doctor/validator/template/flutter_template_validation_config.yml +30 -1
  30. data/solara/lib/core/doctor/validator/template/ios_template_validation_config.yml +35 -1
  31. data/solara/lib/core/doctor/validator/template/template_validator.rb +9 -9
  32. data/solara/lib/core/scripts/brand_config_manager.rb +1 -1
  33. data/solara/lib/core/scripts/brand_configurations_manager.rb +41 -0
  34. data/solara/lib/core/scripts/code_generator.rb +342 -118
  35. data/solara/lib/core/scripts/file_path.rb +21 -1
  36. data/solara/lib/core/scripts/gitignore_manager.rb +11 -3
  37. data/solara/lib/core/scripts/json_manifest_processor.rb +95 -0
  38. data/solara/lib/core/scripts/platform/ios/infoplist_string_catalog_manager.rb +11 -1
  39. data/solara/lib/core/scripts/resource_manifest_processor.rb +151 -0
  40. data/solara/lib/core/scripts/solara_status_manager.rb +1 -1
  41. data/solara/lib/core/scripts/theme_generator.rb +21 -242
  42. data/solara/lib/core/solara_configurator.rb +1 -1
  43. data/solara/lib/core/template/brands/global/resources_manifest.json +10 -0
  44. data/solara/lib/core/template/brands/json/Json-Manifest.md +61 -0
  45. data/solara/lib/core/template/brands/json/json_manifest.json +18 -0
  46. data/solara/lib/core/template/brands/shared/theme.json +213 -29
  47. data/solara/lib/core/template/config/android_template_config.json +50 -0
  48. data/solara/lib/core/template/config/flutter_template_config.json +35 -0
  49. data/solara/lib/core/template/config/ios_template_config.json +50 -0
  50. data/solara/lib/core/template/configurations.json +46 -0
  51. data/solara/lib/core/template/project_template_generator.rb +2 -0
  52. data/solara/lib/solara/version.rb +1 -1
  53. data/solara/lib/solara.rb +19 -0
  54. metadata +13 -4
  55. data/solara/lib/core/dashboard/component/AddFieldSheet.js +0 -175
  56. data/solara/lib/core/dashboard/handler/brand_configurations_manager.rb +0 -73
@@ -0,0 +1,61 @@
1
+ # JSON Structure and Usage
2
+
3
+ JSON manifest enables the generation of platform-specific code based on the provided JSON files. This enhancement
4
+ streamlines the development process and ensures better code organization for different platforms.
5
+
6
+ Each JSON file will be transformed into a class within the `solara_artifacts` directory.
7
+
8
+ You can place your JSON files in the following directories:
9
+
10
+ - `brands/BRAND/android/json`
11
+ - `brands/BRAND/ios/json`
12
+ - `brands/BRAND/flutter/json`
13
+ - `brands/global/json`
14
+
15
+ ## The Manifest File
16
+
17
+ Each directory contains a `json_manifest.json` file with the following structure:
18
+
19
+ ```json
20
+ {
21
+ "files": [
22
+ {
23
+ "fileName": "",
24
+ "generate": {
25
+ "enabled": true,
26
+ "className": "",
27
+ "customClassNames": [
28
+ {
29
+ "generatedName": "",
30
+ "customName": ""
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ ]
36
+ }
37
+ ```
38
+
39
+ ### Property Descriptions
40
+
41
+ - **files**: An array containing objects that define the JSON files to be processed.
42
+
43
+ - **fileName**: The name of the JSON file. This should include the file extension (e.g., `config.json`).
44
+
45
+ - **generate**: An object that specifies whether to generate a class for the JSON file and the details for that
46
+ class.
47
+
48
+ - **enabled**: A boolean value that indicates if class generation is enabled for this file. If set to `true`, a
49
+ class will be created based on the JSON structure.
50
+
51
+ - **className**: The name of the class that will be generated from the JSON file. This is typically derived from
52
+ the `fileName`.
53
+
54
+ - **customClassNames**: An array of objects that allow you to specify custom names for generated classes.
55
+
56
+ - **generatedName**: The name of the class as it would be generated by default.
57
+
58
+ - **customName**: The custom name you want to assign to the generated class instead of the default
59
+ `generatedName`. This is useful for maintaining consistency or aligning with existing naming conventions
60
+ in your codebase.
61
+
@@ -0,0 +1,18 @@
1
+ {
2
+ "description": "This file specifies the JSON files that can be optionally generated for the target platform code.",
3
+ "files": [
4
+ {
5
+ "fileName": "",
6
+ "generate": {
7
+ "enabled": true,
8
+ "className": "",
9
+ "customClassNames": [
10
+ {
11
+ "generatedName": "",
12
+ "customName": ""
13
+ }
14
+ ]
15
+ }
16
+ }
17
+ ]
18
+ }
@@ -1,46 +1,230 @@
1
1
  {
2
2
  "name": "BrandTheme",
3
3
  "version": "1.0.0",
4
- "colors": {
5
- "primary": "#007AFF",
6
- "secondary": "#5AC8FA",
7
- "background": "#FFFFFF",
8
- "surface": "#F2F2F7",
9
- "error": "#FF3B30",
10
- "onPrimary": "#FFFFFF",
11
- "onSecondary": "#000000",
12
- "onBackground": "#000000",
13
- "onSurface": "#000000",
14
- "onError": "#FFFFFF"
4
+ "colorSchemes": {
5
+ "light": {
6
+ "primary": "#6750A4",
7
+ "onPrimary": "#FFFFFF",
8
+ "primaryContainer": "#EADDFF",
9
+ "onPrimaryContainer": "#21005D",
10
+ "secondary": "#625B71",
11
+ "onSecondary": "#FFFFFF",
12
+ "secondaryContainer": "#E8DEF8",
13
+ "onSecondaryContainer": "#1D192B",
14
+ "tertiary": "#7D5260",
15
+ "onTertiary": "#FFFFFF",
16
+ "tertiaryContainer": "#FFD8E4",
17
+ "onTertiaryContainer": "#31111D",
18
+ "error": "#B3261E",
19
+ "onError": "#FFFFFF",
20
+ "errorContainer": "#F9DEDC",
21
+ "onErrorContainer": "#410E0B",
22
+ "background": "#FFFBFE",
23
+ "onBackground": "#1C1B1F",
24
+ "surface": "#FFFBFE",
25
+ "onSurface": "#1C1B1F",
26
+ "surfaceVariant": "#E7E0EC",
27
+ "onSurfaceVariant": "#49454F",
28
+ "outline": "#79747E",
29
+ "outlineVariant": "#CAC4D0",
30
+ "shadow": "#000000",
31
+ "scrim": "#000000",
32
+ "inverseSurface": "#313033",
33
+ "inverseOnSurface": "#F4EFF4",
34
+ "inversePrimary": "#D0BCFF",
35
+ "surfaceDim": "#DED8E1",
36
+ "surfaceBright": "#FFFBFE",
37
+ "surfaceTint": "#F0F0F0",
38
+ "surfaceContainerLowest": "#FFFFFF",
39
+ "surfaceContainerLow": "#F7F2FA",
40
+ "surfaceContainer": "#F3EDF7",
41
+ "surfaceContainerHigh": "#ECE6F0",
42
+ "surfaceContainerHighest": "#E6E0E9",
43
+ "primaryFixed": "#6A5ACD",
44
+ "primaryFixedDim": "#5B4B9A",
45
+ "onPrimaryFixed": "#FFFFFF",
46
+ "onPrimaryFixedVariant": "#21005D",
47
+ "secondaryFixed": "#7A6A8A",
48
+ "secondaryFixedDim": "#6B5B71",
49
+ "onSecondaryFixed": "#FFFFFF",
50
+ "onSecondaryFixedVariant": "#2C2735",
51
+ "tertiaryFixed": "#DA6A76",
52
+ "tertiaryFixedDim": "#C65B65",
53
+ "onTertiaryFixed": "#FFFFFF",
54
+ "onTertiaryFixedVariant": "#492532",
55
+ "onInverseSurface": "#FFFFFF"
56
+ },
57
+ "dark": {
58
+ "primary": "#D0BCFF",
59
+ "onPrimary": "#381E72",
60
+ "primaryContainer": "#4F378B",
61
+ "onPrimaryContainer": "#EADDFF",
62
+ "secondary": "#CCC2DC",
63
+ "onSecondary": "#332D41",
64
+ "secondaryContainer": "#4A4458",
65
+ "onSecondaryContainer": "#E8DEF8",
66
+ "tertiary": "#EFB8C8",
67
+ "onTertiary": "#492532",
68
+ "tertiaryContainer": "#633B48",
69
+ "onTertiaryContainer": "#FFD8E4",
70
+ "error": "#F2B8B5",
71
+ "onError": "#601410",
72
+ "errorContainer": "#8C1D18",
73
+ "onErrorContainer": "#F9DEDC",
74
+ "background": "#1C1B1F",
75
+ "onBackground": "#E6E1E5",
76
+ "surface": "#1C1B1F",
77
+ "onSurface": "#E6E1E5",
78
+ "surfaceVariant": "#49454F",
79
+ "onSurfaceVariant": "#CAC4D0",
80
+ "outline": "#938F99",
81
+ "outlineVariant": "#49454F",
82
+ "shadow": "#000000",
83
+ "scrim": "#000000",
84
+ "inverseSurface": "#E6E1E5",
85
+ "inverseOnSurface": "#313033",
86
+ "inversePrimary": "#6750A4",
87
+ "surfaceDim": "#141218",
88
+ "surfaceBright": "#3B383E",
89
+ "surfaceTint": "#121212",
90
+ "surfaceContainerLowest": "#0F0D13",
91
+ "surfaceContainerLow": "#1D1B20",
92
+ "surfaceContainer": "#211F26",
93
+ "surfaceContainerHigh": "#2B2930",
94
+ "surfaceContainerHighest": "#36343B",
95
+ "primaryFixed": "#B0A4E0",
96
+ "primaryFixedDim": "#A08DBE",
97
+ "onPrimaryFixed": "#381E72",
98
+ "onPrimaryFixedVariant": "#EADDFF",
99
+ "secondaryFixed": "#A69DB3",
100
+ "secondaryFixedDim": "#8C8A94",
101
+ "onSecondaryFixed": "#332D41",
102
+ "onSecondaryFixedVariant": "#E8DEF8",
103
+ "tertiaryFixed": "#EFB8C8",
104
+ "tertiaryFixedDim": "#C65B65",
105
+ "onTertiaryFixed": "#492532",
106
+ "onTertiaryFixedVariant": "#FFD8E4",
107
+ "onInverseSurface": "#1C1B1F"
108
+ }
15
109
  },
16
110
  "typography": {
17
111
  "fontFamily": {
18
- "regular": "",
19
- "medium": "",
20
- "bold": ""
112
+ "regular": "Roboto, sans-serif",
113
+ "medium": "Roboto-Medium, sans-serif",
114
+ "bold": "Roboto-Bold, sans-serif"
21
115
  },
22
116
  "fontSize": {
23
- "small": 12,
24
- "medium": 16,
25
- "large": 20,
26
- "extraLarge": 24
117
+ "caption": 12,
118
+ "body1": 16,
119
+ "body2": 14,
120
+ "subtitle1": 16,
121
+ "subtitle2": 14,
122
+ "h6": 20,
123
+ "h5": 24,
124
+ "h4": 34,
125
+ "h3": 48,
126
+ "h2": 60,
127
+ "h1": 96
128
+ },
129
+ "fontWeight": {
130
+ "light": 300,
131
+ "regular": 400,
132
+ "medium": 500,
133
+ "bold": 700
134
+ },
135
+ "lineHeight": {
136
+ "tight": 1.2,
137
+ "normal": 1.5,
138
+ "relaxed": 1.8
139
+ },
140
+ "letterSpacing": {
141
+ "tight": -0.5,
142
+ "normal": 0,
143
+ "wide": 0.5
27
144
  }
28
145
  },
29
146
  "spacing": {
30
- "small": 8,
31
- "medium": 16,
32
- "large": 24,
33
- "extraLarge": 32
147
+ "xxs": 4,
148
+ "xs": 8,
149
+ "sm": 12,
150
+ "md": 16,
151
+ "lg": 24,
152
+ "xl": 32,
153
+ "xxl": 48
34
154
  },
35
155
  "borderRadius": {
36
- "small": 4,
37
- "medium": 8,
38
- "large": 12
156
+ "none": 0,
157
+ "sm": 4,
158
+ "md": 8,
159
+ "lg": 12,
160
+ "full": 9999
39
161
  },
40
162
  "elevation": {
41
- "none": 0,
42
- "low": 2,
43
- "medium": 4,
44
- "high": 8
163
+ "none": {
164
+ "shadowColor": "#000000",
165
+ "shadowOffset": {
166
+ "width": 0,
167
+ "height": 0
168
+ },
169
+ "shadowOpacity": 0,
170
+ "shadowRadius": 0,
171
+ "elevation": 0
172
+ },
173
+ "low": {
174
+ "shadowColor": "#000000",
175
+ "shadowOffset": {
176
+ "width": 0,
177
+ "height": 2
178
+ },
179
+ "shadowOpacity": 0.1,
180
+ "shadowRadius": 4,
181
+ "elevation": 2
182
+ },
183
+ "medium": {
184
+ "shadowColor": "#000000",
185
+ "shadowOffset": {
186
+ "width": 0,
187
+ "height": 4
188
+ },
189
+ "shadowOpacity": 0.15,
190
+ "shadowRadius": 8,
191
+ "elevation": 4
192
+ },
193
+ "high": {
194
+ "shadowColor": "#000000",
195
+ "shadowOffset": {
196
+ "width": 0,
197
+ "height": 8
198
+ },
199
+ "shadowOpacity": 0.2,
200
+ "shadowRadius": 16,
201
+ "elevation": 8
202
+ }
203
+ },
204
+ "opacity": {
205
+ "disabled": 0.38,
206
+ "hovered": 0.08,
207
+ "focused": 0.12,
208
+ "pressed": 0.16,
209
+ "dragged": 0.24
210
+ },
211
+ "animation": {
212
+ "duration": {
213
+ "short": 200,
214
+ "medium": 300,
215
+ "long": 400
216
+ },
217
+ "easing": {
218
+ "standard": "cubic-bezier(0.4, 0.0, 0.2, 1)",
219
+ "accelerate": "cubic-bezier(0.4, 0.0, 1, 1)",
220
+ "decelerate": "cubic-bezier(0.0, 0.0, 0.2, 1)"
221
+ }
222
+ },
223
+ "breakpoints": {
224
+ "xs": 0,
225
+ "sm": 600,
226
+ "md": 960,
227
+ "lg": 1280,
228
+ "xl": 1920
45
229
  }
46
230
  }
@@ -59,6 +59,56 @@
59
59
  "source": "shared/brand_config.json",
60
60
  "target": "shared/brand_config.json",
61
61
  "condition": "true"
62
+ },
63
+ {
64
+ "source": "json/",
65
+ "target": "android/json/",
66
+ "condition": "true"
67
+ },
68
+ {
69
+ "source": "json/",
70
+ "target": "ios/json/",
71
+ "condition": "true"
72
+ },
73
+ {
74
+ "source": "json/json_manifest.json",
75
+ "target": "android/json/",
76
+ "condition": "true"
77
+ },
78
+ {
79
+ "source": "json/json_manifest.json",
80
+ "target": "ios/json/",
81
+ "condition": "true"
82
+ },
83
+ {
84
+ "source": "json/Json-Manifest.md",
85
+ "target": "android/json/",
86
+ "condition": "true"
87
+ },
88
+ {
89
+ "source": "json/Json-Manifest.md",
90
+ "target": "ios/json/",
91
+ "condition": "true"
92
+ },
93
+ {
94
+ "source": "json/",
95
+ "target": "../../global/json",
96
+ "condition": "true"
97
+ },
98
+ {
99
+ "source": "json/json_manifest.json",
100
+ "target": "../../global/json",
101
+ "condition": "true"
102
+ },
103
+ {
104
+ "source": "json/Json-Manifest.md",
105
+ "target": "../../global/json",
106
+ "condition": "true"
107
+ },
108
+ {
109
+ "source": "global/resources_manifest.json",
110
+ "target": "../../global/resources_manifest.json",
111
+ "condition": "true"
62
112
  }
63
113
  ],
64
114
  "variables": {
@@ -64,6 +64,41 @@
64
64
  "source": "shared/brand_config.json",
65
65
  "target": "shared/brand_config.json",
66
66
  "condition": "true"
67
+ },
68
+ {
69
+ "source": "json/",
70
+ "target": "flutter/json/",
71
+ "condition": "true"
72
+ },
73
+ {
74
+ "source": "json/json_manifest.json",
75
+ "target": "flutter/json/",
76
+ "condition": "true"
77
+ },
78
+ {
79
+ "source": "json/Json-Manifest.md",
80
+ "target": "flutter/json/",
81
+ "condition": "true"
82
+ },
83
+ {
84
+ "source": "json/",
85
+ "target": "../../global/json",
86
+ "condition": "true"
87
+ },
88
+ {
89
+ "source": "json/json_manifest.json",
90
+ "target": "../../global/json",
91
+ "condition": "true"
92
+ },
93
+ {
94
+ "source": "json/Json-Manifest.md",
95
+ "target": "../../global/json",
96
+ "condition": "true"
97
+ },
98
+ {
99
+ "source": "global/resources_manifest.json",
100
+ "target": "../../global/resources_manifest.json",
101
+ "condition": "true"
67
102
  }
68
103
  ],
69
104
  "variables": {
@@ -59,6 +59,56 @@
59
59
  "source": "shared/brand_config.json",
60
60
  "target": "shared/brand_config.json",
61
61
  "condition": "true"
62
+ },
63
+ {
64
+ "source": "json/",
65
+ "target": "android/json/",
66
+ "condition": "true"
67
+ },
68
+ {
69
+ "source": "json/",
70
+ "target": "ios/json/",
71
+ "condition": "true"
72
+ },
73
+ {
74
+ "source": "json/json_manifest.json",
75
+ "target": "android/json/",
76
+ "condition": "true"
77
+ },
78
+ {
79
+ "source": "json/json_manifest.json",
80
+ "target": "ios/json/",
81
+ "condition": "true"
82
+ },
83
+ {
84
+ "source": "json/Json-Manifest.md",
85
+ "target": "android/json/",
86
+ "condition": "true"
87
+ },
88
+ {
89
+ "source": "json/Json-Manifest.md",
90
+ "target": "ios/json/",
91
+ "condition": "true"
92
+ },
93
+ {
94
+ "source": "json/",
95
+ "target": "../../global/json",
96
+ "condition": "true"
97
+ },
98
+ {
99
+ "source": "json/json_manifest.json",
100
+ "target": "../../global/json",
101
+ "condition": "true"
102
+ },
103
+ {
104
+ "source": "json/Json-Manifest.md",
105
+ "target": "../../global/json",
106
+ "condition": "true"
107
+ },
108
+ {
109
+ "source": "global/resources_manifest.json",
110
+ "target": "../../global/resources_manifest.json",
111
+ "condition": "true"
62
112
  }
63
113
  ],
64
114
  "variables": {
@@ -0,0 +1,46 @@
1
+ {
2
+ "configurations": [
3
+ {
4
+ "key": "brand_config.json",
5
+ "name": "Brand Configuration",
6
+ "filePath": "shared/brand_config.json",
7
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/shared/brand_config.json"
8
+ },
9
+ {
10
+ "key": "theme.json",
11
+ "name": "Theme Configuration",
12
+ "filePath": "shared/theme.json",
13
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/shared/theme.json"
14
+ },
15
+ {
16
+ "key": "android_config.json",
17
+ "name": "Android Configuration",
18
+ "filePath": "android/android_config.json",
19
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/android/android_config.json"
20
+ },
21
+ {
22
+ "key": "android_signing.json",
23
+ "name": "Android Signing",
24
+ "filePath": "android/android_signing.json",
25
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/android/android_signing.json"
26
+ },
27
+ {
28
+ "key": "ios_config.json",
29
+ "name": "iOS Configuration",
30
+ "filePath": "ios/ios_config.json",
31
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/ios/ios_config.json"
32
+ },
33
+ {
34
+ "key": "ios_signing.json",
35
+ "name": "iOS Signing",
36
+ "filePath": "ios/ios_signing.json",
37
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/ios/ios_signing.json"
38
+ },
39
+ {
40
+ "key": "InfoPlist.xcstrings",
41
+ "name": "InfoPlist.xcstrings",
42
+ "filePath": "ios/InfoPlist.xcstrings",
43
+ "url": "https://raw.githubusercontent.com/Solara-Kit/Solara/refs/heads/develop/solara/lib/core/template/brands/ios/InfoPlist.xcstrings"
44
+ }
45
+ ]
46
+ }
@@ -46,6 +46,8 @@ class ProjectTemplateGenerator
46
46
  end
47
47
  else
48
48
  FileUtils.mkdir_p(File.dirname(target))
49
+ return if File.exist?(target)
50
+
49
51
  if File.exist?(source) && copy_content
50
52
  FileUtils.cp(source, target)
51
53
  else
@@ -1,3 +1,3 @@
1
1
  module Solara
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
data/solara/lib/solara.rb CHANGED
@@ -153,6 +153,25 @@ module Solara
153
153
 
154
154
  end
155
155
 
156
+ desc "`sync", "Sync the changes of the current brand through switching."
157
+ def sync
158
+ check_project_health
159
+
160
+ current_brand = BrandsManager.instance.current_brand
161
+ unless current_brand
162
+ Solara.logger.fatal("Please switch a brand first in order to enable synchronization.")
163
+ exit 1
164
+ end
165
+ brand_key = current_brand['key']
166
+
167
+ begin
168
+ SolaraManager.new.switch(brand_key)
169
+ rescue Issue => e
170
+ Solara.logger.fatal("Switching to #{brand_key} failed.")
171
+ exit 1
172
+ end
173
+ end
174
+
156
175
  desc "dashboard -k YOUR_OPTIONAL_BRAND_KEY", "Open the dashboard for a brand if brank_key is provided."
157
176
  method_option :brand_key, :type => :string, :aliases => "-k"
158
177
  method_option :port, :type => :numeric, :aliases => "-p"