@microsoft/teamsfx-core 1.2.0 → 1.2.2-alpha.eb4575da.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 (520) hide show
  1. package/build/common/armInterface.d.ts +0 -20
  2. package/build/common/armInterface.d.ts.map +1 -1
  3. package/build/common/deps-checker/depsChecker.d.ts +1 -0
  4. package/build/common/deps-checker/depsChecker.d.ts.map +1 -1
  5. package/build/common/deps-checker/depsChecker.js.map +1 -1
  6. package/build/common/deps-checker/depsManager.d.ts +2 -1
  7. package/build/common/deps-checker/depsManager.d.ts.map +1 -1
  8. package/build/common/deps-checker/depsManager.js +12 -7
  9. package/build/common/deps-checker/depsManager.js.map +1 -1
  10. package/build/common/deps-checker/index.d.ts +1 -0
  11. package/build/common/deps-checker/index.d.ts.map +1 -1
  12. package/build/common/deps-checker/index.js +1 -0
  13. package/build/common/deps-checker/index.js.map +1 -1
  14. package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
  15. package/build/common/deps-checker/internal/dotnetChecker.js +2 -1
  16. package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
  17. package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
  18. package/build/common/deps-checker/internal/funcToolChecker.js +2 -1
  19. package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
  20. package/build/common/deps-checker/internal/ngrokChecker.d.ts +1 -1
  21. package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +1 -1
  22. package/build/common/deps-checker/internal/ngrokChecker.js +2 -4
  23. package/build/common/deps-checker/internal/ngrokChecker.js.map +1 -1
  24. package/build/common/deps-checker/internal/nodeChecker.d.ts +1 -0
  25. package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -1
  26. package/build/common/deps-checker/internal/nodeChecker.js +9 -1
  27. package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
  28. package/build/common/deps-checker/util/extensionInstaller.d.ts +3 -0
  29. package/build/common/deps-checker/util/extensionInstaller.d.ts.map +1 -0
  30. package/build/common/deps-checker/util/extensionInstaller.js +47 -0
  31. package/build/common/deps-checker/util/extensionInstaller.js.map +1 -0
  32. package/build/common/deps-checker/util/index.d.ts +5 -0
  33. package/build/common/deps-checker/util/index.d.ts.map +1 -0
  34. package/build/common/deps-checker/util/index.js +10 -0
  35. package/build/common/deps-checker/util/index.js.map +1 -0
  36. package/build/common/index.d.ts +1 -3
  37. package/build/common/index.d.ts.map +1 -1
  38. package/build/common/index.js +1 -3
  39. package/build/common/index.js.map +1 -1
  40. package/build/common/local/constants.d.ts +5 -0
  41. package/build/common/local/constants.d.ts.map +1 -1
  42. package/build/common/local/constants.js +7 -1
  43. package/build/common/local/constants.js.map +1 -1
  44. package/build/common/local/index.d.ts +5 -0
  45. package/build/common/local/index.d.ts.map +1 -0
  46. package/build/common/local/index.js +10 -0
  47. package/build/common/local/index.js.map +1 -0
  48. package/build/{plugins/solution/fx-solution/debug/util/certificate.d.ts → common/local/localCertificateManager.d.ts} +4 -6
  49. package/build/common/local/localCertificateManager.d.ts.map +1 -0
  50. package/build/{plugins/solution/fx-solution/debug/util/certificate.js → common/local/localCertificateManager.js} +37 -47
  51. package/build/common/local/localCertificateManager.js.map +1 -0
  52. package/build/common/local/localEnvManager.d.ts +6 -2
  53. package/build/common/local/localEnvManager.d.ts.map +1 -1
  54. package/build/common/local/localEnvManager.js +41 -1
  55. package/build/common/local/localEnvManager.js.map +1 -1
  56. package/build/{plugins/solution/fx-solution/debug/util → common/local}/process.d.ts +0 -0
  57. package/build/common/local/process.d.ts.map +1 -0
  58. package/build/{plugins/solution/fx-solution/debug/util → common/local}/process.js +0 -0
  59. package/build/common/local/process.js.map +1 -0
  60. package/build/common/local/projectSettingsHelper.d.ts +5 -5
  61. package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
  62. package/build/common/local/projectSettingsHelper.js +28 -21
  63. package/build/common/local/projectSettingsHelper.js.map +1 -1
  64. package/build/common/local/taskDefinition.d.ts +1 -1
  65. package/build/common/local/taskDefinition.d.ts.map +1 -1
  66. package/build/common/local/taskDefinition.js +6 -4
  67. package/build/common/local/taskDefinition.js.map +1 -1
  68. package/build/common/localSettingsConstants.d.ts +1 -0
  69. package/build/common/localSettingsConstants.d.ts.map +1 -1
  70. package/build/common/localSettingsConstants.js +1 -0
  71. package/build/common/localSettingsConstants.js.map +1 -1
  72. package/build/common/localSettingsProvider.d.ts.map +1 -1
  73. package/build/common/localSettingsProvider.js +1 -0
  74. package/build/common/localSettingsProvider.js.map +1 -1
  75. package/build/common/permissionInterface.d.ts +1 -0
  76. package/build/common/permissionInterface.d.ts.map +1 -1
  77. package/build/common/permissionInterface.js +1 -0
  78. package/build/common/permissionInterface.js.map +1 -1
  79. package/build/common/telemetry.d.ts +7 -2
  80. package/build/common/telemetry.d.ts.map +1 -1
  81. package/build/common/telemetry.js +10 -4
  82. package/build/common/telemetry.js.map +1 -1
  83. package/build/common/{templates.d.ts → template-utils/templates.d.ts} +0 -0
  84. package/build/common/template-utils/templates.d.ts.map +1 -0
  85. package/build/common/{templates.js → template-utils/templates.js} +1 -1
  86. package/build/common/template-utils/templates.js.map +1 -0
  87. package/build/common/{templatesActions.d.ts → template-utils/templatesActions.d.ts} +0 -0
  88. package/build/common/template-utils/templatesActions.d.ts.map +1 -0
  89. package/build/common/{templatesActions.js → template-utils/templatesActions.js} +3 -3
  90. package/build/common/template-utils/templatesActions.js.map +1 -0
  91. package/build/common/{templatesUtils.d.ts → template-utils/templatesUtils.d.ts} +0 -0
  92. package/build/common/template-utils/templatesUtils.d.ts.map +1 -0
  93. package/build/common/{templatesUtils.js → template-utils/templatesUtils.js} +1 -1
  94. package/build/common/template-utils/templatesUtils.js.map +1 -0
  95. package/build/common/tools.d.ts +1 -4
  96. package/build/common/tools.d.ts.map +1 -1
  97. package/build/common/tools.js +41 -12
  98. package/build/common/tools.js.map +1 -1
  99. package/build/core/index.d.ts +2 -2
  100. package/build/core/index.d.ts.map +1 -1
  101. package/build/core/index.js +14 -6
  102. package/build/core/index.js.map +1 -1
  103. package/build/core/middleware/index.d.ts +0 -1
  104. package/build/core/middleware/index.d.ts.map +1 -1
  105. package/build/core/middleware/index.js +0 -1
  106. package/build/core/middleware/index.js.map +1 -1
  107. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  108. package/build/core/middleware/projectMigrator.js +0 -9
  109. package/build/core/middleware/projectMigrator.js.map +1 -1
  110. package/build/core/permissionRequest.js +2 -2
  111. package/build/core/permissionRequest.js.map +1 -1
  112. package/build/core/question.d.ts.map +1 -1
  113. package/build/core/question.js +7 -4
  114. package/build/core/question.js.map +1 -1
  115. package/build/plugins/resource/aad/aadAppClient.d.ts +2 -2
  116. package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
  117. package/build/plugins/resource/aad/aadAppClient.js +3 -4
  118. package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
  119. package/build/plugins/resource/aad/errors.d.ts.map +1 -1
  120. package/build/plugins/resource/aad/errors.js +1 -2
  121. package/build/plugins/resource/aad/errors.js.map +1 -1
  122. package/build/plugins/resource/aad/interfaces/IAADDefinition.d.ts +4 -0
  123. package/build/plugins/resource/aad/interfaces/IAADDefinition.d.ts.map +1 -1
  124. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  125. package/build/plugins/resource/aad/plugin.js +33 -46
  126. package/build/plugins/resource/aad/plugin.js.map +1 -1
  127. package/build/plugins/resource/aad/utils/common.d.ts +2 -0
  128. package/build/plugins/resource/aad/utils/common.d.ts.map +1 -1
  129. package/build/plugins/resource/aad/utils/common.js +14 -14
  130. package/build/plugins/resource/aad/utils/common.js.map +1 -1
  131. package/build/plugins/resource/aad/utils/configs.d.ts +1 -0
  132. package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
  133. package/build/plugins/resource/aad/utils/configs.js +20 -38
  134. package/build/plugins/resource/aad/utils/configs.js.map +1 -1
  135. package/build/plugins/resource/apim/error.d.ts.map +1 -1
  136. package/build/plugins/resource/apim/error.js +1 -4
  137. package/build/plugins/resource/apim/error.js.map +1 -1
  138. package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
  139. package/build/plugins/resource/apim/managers/apimManager.js +21 -58
  140. package/build/plugins/resource/apim/managers/apimManager.js.map +1 -1
  141. package/build/plugins/resource/apim/managers/questionManager.d.ts.map +1 -1
  142. package/build/plugins/resource/apim/managers/questionManager.js +0 -7
  143. package/build/plugins/resource/apim/managers/questionManager.js.map +1 -1
  144. package/build/plugins/resource/apim/questions/vscodeQuestion.d.ts.map +1 -1
  145. package/build/plugins/resource/apim/questions/vscodeQuestion.js +6 -13
  146. package/build/plugins/resource/apim/questions/vscodeQuestion.js.map +1 -1
  147. package/build/plugins/resource/appstudio/constants.d.ts +3 -2
  148. package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
  149. package/build/plugins/resource/appstudio/constants.js +12 -11
  150. package/build/plugins/resource/appstudio/constants.js.map +1 -1
  151. package/build/plugins/resource/appstudio/index.d.ts +2 -36
  152. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  153. package/build/plugins/resource/appstudio/index.js +1 -31
  154. package/build/plugins/resource/appstudio/index.js.map +1 -1
  155. package/build/plugins/resource/appstudio/manifestTemplate.d.ts +1 -1
  156. package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
  157. package/build/plugins/resource/appstudio/manifestTemplate.js +16 -8
  158. package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
  159. package/build/plugins/resource/appstudio/plugin.d.ts +1 -0
  160. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  161. package/build/plugins/resource/appstudio/plugin.js +14 -1
  162. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  163. package/build/plugins/resource/appstudio/v3/index.d.ts +1 -3
  164. package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
  165. package/build/plugins/resource/appstudio/v3/index.js +28 -16
  166. package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
  167. package/build/plugins/resource/bot/configs/provisionConfig.d.ts.map +1 -1
  168. package/build/plugins/resource/bot/configs/provisionConfig.js +0 -10
  169. package/build/plugins/resource/bot/configs/provisionConfig.js.map +1 -1
  170. package/build/plugins/resource/bot/languageStrategy.d.ts +1 -1
  171. package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
  172. package/build/plugins/resource/bot/languageStrategy.js +1 -1
  173. package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
  174. package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
  175. package/build/plugins/resource/bot/plugin.js +14 -131
  176. package/build/plugins/resource/bot/plugin.js.map +1 -1
  177. package/build/plugins/resource/frontend/configs.d.ts +1 -1
  178. package/build/plugins/resource/frontend/configs.d.ts.map +1 -1
  179. package/build/plugins/resource/frontend/configs.js +3 -9
  180. package/build/plugins/resource/frontend/configs.js.map +1 -1
  181. package/build/plugins/resource/frontend/constants.d.ts +2 -8
  182. package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
  183. package/build/plugins/resource/frontend/constants.js +3 -11
  184. package/build/plugins/resource/frontend/constants.js.map +1 -1
  185. package/build/plugins/resource/frontend/dotnet/constants.d.ts +52 -0
  186. package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -0
  187. package/build/plugins/resource/frontend/dotnet/constants.js +69 -0
  188. package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -0
  189. package/build/plugins/resource/frontend/{blazor → dotnet}/enum.d.ts +1 -1
  190. package/build/plugins/resource/frontend/{blazor → dotnet}/enum.d.ts.map +1 -1
  191. package/build/plugins/resource/frontend/dotnet/enum.js +39 -0
  192. package/build/plugins/resource/frontend/{blazor → dotnet}/enum.js.map +1 -1
  193. package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.d.ts +0 -0
  194. package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.d.ts.map +1 -1
  195. package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.js +3 -3
  196. package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.js.map +1 -1
  197. package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.d.ts +0 -0
  198. package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.d.ts.map +1 -1
  199. package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.js +3 -3
  200. package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.js.map +1 -1
  201. package/build/plugins/resource/frontend/dotnet/plugin.d.ts +34 -0
  202. package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -0
  203. package/build/plugins/resource/frontend/dotnet/plugin.js +126 -0
  204. package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -0
  205. package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts +35 -0
  206. package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts.map +1 -0
  207. package/build/plugins/resource/frontend/{blazor → dotnet}/resources/errors.js +10 -22
  208. package/build/plugins/resource/frontend/dotnet/resources/errors.js.map +1 -0
  209. package/build/plugins/resource/frontend/{blazor → dotnet}/resources/messages.d.ts +0 -4
  210. package/build/plugins/resource/frontend/dotnet/resources/messages.d.ts.map +1 -0
  211. package/build/plugins/resource/frontend/{blazor → dotnet}/resources/messages.js +0 -4
  212. package/build/plugins/resource/frontend/dotnet/resources/messages.js.map +1 -0
  213. package/build/plugins/resource/frontend/dotnet/utils/azure-client.d.ts +6 -0
  214. package/build/plugins/resource/frontend/dotnet/utils/azure-client.d.ts.map +1 -0
  215. package/build/plugins/resource/frontend/dotnet/utils/azure-client.js +11 -0
  216. package/build/plugins/resource/frontend/dotnet/utils/azure-client.js.map +1 -0
  217. package/build/plugins/resource/frontend/index.d.ts +6 -3
  218. package/build/plugins/resource/frontend/index.d.ts.map +1 -1
  219. package/build/plugins/resource/frontend/index.js +27 -45
  220. package/build/plugins/resource/frontend/index.js.map +1 -1
  221. package/build/plugins/resource/frontend/interface.d.ts +13 -0
  222. package/build/plugins/resource/frontend/interface.d.ts.map +1 -0
  223. package/build/plugins/resource/frontend/interface.js +3 -0
  224. package/build/plugins/resource/frontend/interface.js.map +1 -0
  225. package/build/plugins/resource/frontend/ops/deploy.d.ts +3 -0
  226. package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
  227. package/build/plugins/resource/frontend/ops/deploy.js +43 -0
  228. package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
  229. package/build/plugins/resource/frontend/ops/scaffold.d.ts.map +1 -1
  230. package/build/plugins/resource/frontend/ops/scaffold.js +1 -1
  231. package/build/plugins/resource/frontend/ops/scaffold.js.map +1 -1
  232. package/build/plugins/resource/frontend/plugin.d.ts +3 -3
  233. package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
  234. package/build/plugins/resource/frontend/plugin.js +13 -44
  235. package/build/plugins/resource/frontend/plugin.js.map +1 -1
  236. package/build/plugins/resource/frontend/resources/errors.d.ts +23 -20
  237. package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
  238. package/build/plugins/resource/frontend/resources/errors.js +31 -67
  239. package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
  240. package/build/plugins/resource/frontend/resources/templateInfo.js +1 -1
  241. package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
  242. package/build/plugins/resource/frontend/utils/logger.d.ts +3 -1
  243. package/build/plugins/resource/frontend/utils/logger.d.ts.map +1 -1
  244. package/build/plugins/resource/frontend/utils/logger.js +9 -6
  245. package/build/plugins/resource/frontend/utils/logger.js.map +1 -1
  246. package/build/plugins/resource/frontend/utils/progress-helper.d.ts +0 -8
  247. package/build/plugins/resource/frontend/utils/progress-helper.d.ts.map +1 -1
  248. package/build/plugins/resource/frontend/utils/progress-helper.js +1 -19
  249. package/build/plugins/resource/frontend/utils/progress-helper.js.map +1 -1
  250. package/build/plugins/resource/frontend/v2/index.d.ts +1 -0
  251. package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
  252. package/build/plugins/resource/frontend/v2/index.js +3 -0
  253. package/build/plugins/resource/frontend/v2/index.js.map +1 -1
  254. package/build/plugins/resource/frontend/v3/AzureStoragePlugin.d.ts +15 -0
  255. package/build/plugins/resource/frontend/v3/AzureStoragePlugin.d.ts.map +1 -0
  256. package/build/plugins/resource/frontend/v3/AzureStoragePlugin.js +149 -0
  257. package/build/plugins/resource/frontend/v3/AzureStoragePlugin.js.map +1 -0
  258. package/build/plugins/resource/frontend/v3/ReactTabScaffoldPlugin.d.ts +8 -0
  259. package/build/plugins/resource/frontend/v3/ReactTabScaffoldPlugin.d.ts.map +1 -0
  260. package/build/plugins/resource/frontend/v3/ReactTabScaffoldPlugin.js +95 -0
  261. package/build/plugins/resource/frontend/v3/ReactTabScaffoldPlugin.js.map +1 -0
  262. package/build/plugins/resource/frontend/v3/error.d.ts +23 -0
  263. package/build/plugins/resource/frontend/v3/error.d.ts.map +1 -0
  264. package/build/plugins/resource/frontend/v3/error.js +66 -0
  265. package/build/plugins/resource/frontend/v3/error.js.map +1 -0
  266. package/build/plugins/resource/frontend/v3/index.d.ts +3 -0
  267. package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -0
  268. package/build/plugins/resource/frontend/v3/index.js +7 -0
  269. package/build/plugins/resource/frontend/v3/index.js.map +1 -0
  270. package/build/plugins/resource/function/index.d.ts +1 -1
  271. package/build/plugins/resource/function/index.d.ts.map +1 -1
  272. package/build/plugins/resource/function/index.js +8 -21
  273. package/build/plugins/resource/function/index.js.map +1 -1
  274. package/build/plugins/resource/function/ops/deploy.d.ts.map +1 -1
  275. package/build/plugins/resource/function/ops/deploy.js +8 -9
  276. package/build/plugins/resource/function/ops/deploy.js.map +1 -1
  277. package/build/plugins/resource/function/ops/scaffold.js +1 -1
  278. package/build/plugins/resource/function/ops/scaffold.js.map +1 -1
  279. package/build/plugins/resource/function/plugin.d.ts.map +1 -1
  280. package/build/plugins/resource/function/plugin.js +33 -134
  281. package/build/plugins/resource/function/plugin.js.map +1 -1
  282. package/build/plugins/resource/function/resources/message.d.ts +0 -1
  283. package/build/plugins/resource/function/resources/message.d.ts.map +1 -1
  284. package/build/plugins/resource/function/resources/message.js +0 -1
  285. package/build/plugins/resource/function/resources/message.js.map +1 -1
  286. package/build/plugins/resource/function/utils/depsChecker/funcHelper.d.ts +11 -0
  287. package/build/plugins/resource/function/utils/depsChecker/funcHelper.d.ts.map +1 -0
  288. package/build/plugins/resource/function/utils/depsChecker/funcHelper.js +48 -0
  289. package/build/plugins/resource/function/utils/depsChecker/funcHelper.js.map +1 -0
  290. package/build/plugins/resource/function/utils/depsChecker/funcPluginLogger.d.ts +6 -4
  291. package/build/plugins/resource/function/utils/depsChecker/funcPluginLogger.d.ts.map +1 -1
  292. package/build/plugins/resource/function/utils/depsChecker/funcPluginLogger.js +15 -8
  293. package/build/plugins/resource/function/utils/depsChecker/funcPluginLogger.js.map +1 -1
  294. package/build/plugins/resource/function/utils/depsChecker/funcPluginTelemetry.d.ts +4 -3
  295. package/build/plugins/resource/function/utils/depsChecker/funcPluginTelemetry.d.ts.map +1 -1
  296. package/build/plugins/resource/function/utils/depsChecker/funcPluginTelemetry.js +5 -4
  297. package/build/plugins/resource/function/utils/depsChecker/funcPluginTelemetry.js.map +1 -1
  298. package/build/plugins/resource/function/utils/telemetry-helper.d.ts +1 -1
  299. package/build/plugins/resource/function/utils/telemetry-helper.d.ts.map +1 -1
  300. package/build/plugins/resource/identity/index.d.ts +0 -1
  301. package/build/plugins/resource/identity/index.d.ts.map +1 -1
  302. package/build/plugins/resource/identity/index.js +2 -20
  303. package/build/plugins/resource/identity/index.js.map +1 -1
  304. package/build/plugins/resource/simpleauth/index.d.ts.map +1 -1
  305. package/build/plugins/resource/simpleauth/index.js +1 -6
  306. package/build/plugins/resource/simpleauth/index.js.map +1 -1
  307. package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
  308. package/build/plugins/resource/simpleauth/plugin.js +0 -3
  309. package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
  310. package/build/plugins/resource/spfx/plugin.d.ts.map +1 -1
  311. package/build/plugins/resource/spfx/plugin.js +14 -9
  312. package/build/plugins/resource/spfx/plugin.js.map +1 -1
  313. package/build/plugins/resource/spfx/utils/constants.d.ts +5 -4
  314. package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
  315. package/build/plugins/resource/spfx/utils/constants.js +5 -4
  316. package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
  317. package/build/plugins/resource/spfx/utils/progress-helper.d.ts.map +1 -1
  318. package/build/plugins/resource/spfx/utils/progress-helper.js +1 -1
  319. package/build/plugins/resource/spfx/utils/progress-helper.js.map +1 -1
  320. package/build/plugins/resource/sql/index.d.ts.map +1 -1
  321. package/build/plugins/resource/sql/index.js +1 -9
  322. package/build/plugins/resource/sql/index.js.map +1 -1
  323. package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
  324. package/build/plugins/resource/sql/plugin.js +26 -58
  325. package/build/plugins/resource/sql/plugin.js.map +1 -1
  326. package/build/plugins/resource/utils4v2.d.ts +1 -1
  327. package/build/plugins/resource/utils4v2.d.ts.map +1 -1
  328. package/build/plugins/resource/utils4v2.js +3 -3
  329. package/build/plugins/resource/utils4v2.js.map +1 -1
  330. package/build/plugins/solution/fx-solution/arm.d.ts +9 -2
  331. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  332. package/build/plugins/solution/fx-solution/arm.js +45 -11
  333. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  334. package/build/plugins/solution/fx-solution/commonQuestions.d.ts +4 -3
  335. package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
  336. package/build/plugins/solution/fx-solution/commonQuestions.js +11 -10
  337. package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
  338. package/build/plugins/solution/fx-solution/constants.d.ts +1 -0
  339. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  340. package/build/plugins/solution/fx-solution/constants.js +1 -0
  341. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  342. package/build/plugins/solution/fx-solution/debug/constants.d.ts +0 -5
  343. package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -1
  344. package/build/plugins/solution/fx-solution/debug/constants.js +1 -7
  345. package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -1
  346. package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
  347. package/build/plugins/solution/fx-solution/debug/provisionLocal.js +2 -2
  348. package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
  349. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +2 -2
  350. package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
  351. package/build/plugins/solution/fx-solution/debug/scaffolding.js +5 -3
  352. package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
  353. package/build/plugins/solution/fx-solution/question.d.ts +2 -2
  354. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  355. package/build/plugins/solution/fx-solution/question.js +32 -22
  356. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  357. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  358. package/build/plugins/solution/fx-solution/solution.js +15 -15
  359. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  360. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.d.ts +31 -0
  361. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.d.ts.map +1 -0
  362. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.js +222 -0
  363. package/build/plugins/solution/fx-solution/utils/ResourceGroupHelper.js.map +1 -0
  364. package/build/plugins/solution/fx-solution/v2/adaptor.js +1 -1
  365. package/build/plugins/solution/fx-solution/v2/adaptor.js.map +1 -1
  366. package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
  367. package/build/plugins/solution/fx-solution/v2/createEnv.js +1 -3
  368. package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
  369. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +2 -2
  370. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  371. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +196 -122
  372. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  373. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.d.ts +2 -2
  374. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.d.ts.map +1 -1
  375. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.js +9 -14
  376. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.js.map +1 -1
  377. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  378. package/build/plugins/solution/fx-solution/v2/getQuestions.js +81 -96
  379. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  380. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  381. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  382. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  383. package/build/plugins/solution/fx-solution/v2/scaffolding.js +6 -0
  384. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  385. package/build/plugins/solution/fx-solution/v2/utils.js +1 -1
  386. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  387. package/build/plugins/solution/fx-solution/v3/addModule.d.ts +2 -4
  388. package/build/plugins/solution/fx-solution/v3/addModule.d.ts.map +1 -1
  389. package/build/plugins/solution/fx-solution/v3/addModule.js +29 -6
  390. package/build/plugins/solution/fx-solution/v3/addModule.js.map +1 -1
  391. package/build/plugins/solution/fx-solution/v3/addResource.d.ts +6 -14
  392. package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -1
  393. package/build/plugins/solution/fx-solution/v3/addResource.js +23 -51
  394. package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -1
  395. package/build/plugins/solution/fx-solution/v3/constants.d.ts +2 -0
  396. package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -1
  397. package/build/plugins/solution/fx-solution/v3/constants.js +2 -0
  398. package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -1
  399. package/build/plugins/solution/fx-solution/v3/deploy.d.ts +1 -3
  400. package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -1
  401. package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -1
  402. package/build/plugins/solution/fx-solution/v3/init.d.ts.map +1 -1
  403. package/build/plugins/solution/fx-solution/v3/init.js +9 -0
  404. package/build/plugins/solution/fx-solution/v3/init.js.map +1 -1
  405. package/build/plugins/solution/fx-solution/v3/provision.d.ts +8 -1
  406. package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
  407. package/build/plugins/solution/fx-solution/v3/provision.js +219 -16
  408. package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
  409. package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -1
  410. package/build/plugins/solution/fx-solution/v3/provisionLocal.js +96 -1
  411. package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -1
  412. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts +8 -13
  413. package/build/plugins/solution/fx-solution/v3/scaffold.d.ts.map +1 -1
  414. package/build/plugins/solution/fx-solution/v3/scaffold.js +30 -52
  415. package/build/plugins/solution/fx-solution/v3/scaffold.js.map +1 -1
  416. package/build/plugins/solution/spfx-solution/addModule.d.ts +2 -4
  417. package/build/plugins/solution/spfx-solution/addModule.d.ts.map +1 -1
  418. package/build/plugins/solution/spfx-solution/addModule.js +1 -1
  419. package/build/plugins/solution/spfx-solution/addModule.js.map +1 -1
  420. package/build/plugins/solution/spfx-solution/scaffold.d.ts +2 -10
  421. package/build/plugins/solution/spfx-solution/scaffold.d.ts.map +1 -1
  422. package/build/plugins/solution/spfx-solution/scaffold.js +3 -39
  423. package/build/plugins/solution/spfx-solution/scaffold.js.map +1 -1
  424. package/build/plugins/solution/spfx-solution/solution.d.ts +12 -17
  425. package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -1
  426. package/build/plugins/solution/spfx-solution/solution.js +7 -7
  427. package/build/plugins/solution/spfx-solution/solution.js.map +1 -1
  428. package/package.json +6 -7
  429. package/resource/strings.json +17 -7
  430. package/templates/plugins/resource/apim/bicep/apimConfiguration.bicep +1 -0
  431. package/templates/plugins/resource/apim/bicep/apimProvision.bicep +7 -5
  432. package/templates/plugins/resource/apim/bicep/config.template.bicep +1 -0
  433. package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +12 -12
  434. package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +15 -11
  435. package/templates/plugins/resource/bot/bicep/config.template.bicep +2 -0
  436. package/templates/plugins/resource/frontend/bicep/frontendHostingProvision.bicep +4 -2
  437. package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -0
  438. package/templates/plugins/resource/function/bicep/config.template.bicep +2 -0
  439. package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +15 -15
  440. package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +17 -14
  441. package/templates/plugins/resource/identity/bicep/identityProvision.template.bicep +2 -1
  442. package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +9 -7
  443. package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +2 -0
  444. package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +7 -7
  445. package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +9 -6
  446. package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +8 -5
  447. package/templates/plugins/resource/webapp/bicep/config.template.bicep +10 -0
  448. package/templates/plugins/resource/webapp/bicep/provision.template.bicep +16 -0
  449. package/templates/plugins/resource/webapp/bicep/webappConfiguration.template.bicep +74 -0
  450. package/templates/plugins/resource/webapp/bicep/webappProvision.template.bicep +48 -0
  451. package/build/common/templates.d.ts.map +0 -1
  452. package/build/common/templates.js.map +0 -1
  453. package/build/common/templatesActions.d.ts.map +0 -1
  454. package/build/common/templatesActions.js.map +0 -1
  455. package/build/common/templatesUtils.d.ts.map +0 -1
  456. package/build/common/templatesUtils.js.map +0 -1
  457. package/build/core/middleware/projectUpgrader.d.ts +0 -6
  458. package/build/core/middleware/projectUpgrader.d.ts.map +0 -1
  459. package/build/core/middleware/projectUpgrader.js +0 -224
  460. package/build/core/middleware/projectUpgrader.js.map +0 -1
  461. package/build/plugins/resource/frontend/blazor/constants.d.ts +0 -75
  462. package/build/plugins/resource/frontend/blazor/constants.d.ts.map +0 -1
  463. package/build/plugins/resource/frontend/blazor/constants.js +0 -98
  464. package/build/plugins/resource/frontend/blazor/constants.js.map +0 -1
  465. package/build/plugins/resource/frontend/blazor/enum.js +0 -39
  466. package/build/plugins/resource/frontend/blazor/ops/provision.d.ts +0 -8
  467. package/build/plugins/resource/frontend/blazor/ops/provision.d.ts.map +0 -1
  468. package/build/plugins/resource/frontend/blazor/ops/provision.js +0 -42
  469. package/build/plugins/resource/frontend/blazor/ops/provision.js.map +0 -1
  470. package/build/plugins/resource/frontend/blazor/plugin.d.ts +0 -35
  471. package/build/plugins/resource/frontend/blazor/plugin.d.ts.map +0 -1
  472. package/build/plugins/resource/frontend/blazor/plugin.js +0 -190
  473. package/build/plugins/resource/frontend/blazor/plugin.js.map +0 -1
  474. package/build/plugins/resource/frontend/blazor/resources/errors.d.ts +0 -41
  475. package/build/plugins/resource/frontend/blazor/resources/errors.d.ts.map +0 -1
  476. package/build/plugins/resource/frontend/blazor/resources/errors.js.map +0 -1
  477. package/build/plugins/resource/frontend/blazor/resources/messages.d.ts.map +0 -1
  478. package/build/plugins/resource/frontend/blazor/resources/messages.js.map +0 -1
  479. package/build/plugins/resource/frontend/blazor/utils/azure-client.d.ts +0 -21
  480. package/build/plugins/resource/frontend/blazor/utils/azure-client.d.ts.map +0 -1
  481. package/build/plugins/resource/frontend/blazor/utils/azure-client.js +0 -47
  482. package/build/plugins/resource/frontend/blazor/utils/azure-client.js.map +0 -1
  483. package/build/plugins/resource/frontend/utils/azure-client.d.ts +0 -12
  484. package/build/plugins/resource/frontend/utils/azure-client.d.ts.map +0 -1
  485. package/build/plugins/resource/frontend/utils/azure-client.js +0 -29
  486. package/build/plugins/resource/frontend/utils/azure-client.js.map +0 -1
  487. package/build/plugins/resource/function/utils/depsChecker/backendExtensionsInstall.d.ts +0 -9
  488. package/build/plugins/resource/function/utils/depsChecker/backendExtensionsInstall.d.ts.map +0 -1
  489. package/build/plugins/resource/function/utils/depsChecker/backendExtensionsInstall.js +0 -55
  490. package/build/plugins/resource/function/utils/depsChecker/backendExtensionsInstall.js.map +0 -1
  491. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts +0 -54
  492. package/build/plugins/resource/function/utils/depsChecker/checker.d.ts.map +0 -1
  493. package/build/plugins/resource/function/utils/depsChecker/checker.js +0 -104
  494. package/build/plugins/resource/function/utils/depsChecker/checker.js.map +0 -1
  495. package/build/plugins/resource/function/utils/depsChecker/common.d.ts +0 -84
  496. package/build/plugins/resource/function/utils/depsChecker/common.d.ts.map +0 -1
  497. package/build/plugins/resource/function/utils/depsChecker/common.js +0 -136
  498. package/build/plugins/resource/function/utils/depsChecker/common.js.map +0 -1
  499. package/build/plugins/resource/function/utils/depsChecker/cpUtils.d.ts +0 -22
  500. package/build/plugins/resource/function/utils/depsChecker/cpUtils.d.ts.map +0 -1
  501. package/build/plugins/resource/function/utils/depsChecker/cpUtils.js +0 -105
  502. package/build/plugins/resource/function/utils/depsChecker/cpUtils.js.map +0 -1
  503. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts +0 -53
  504. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts.map +0 -1
  505. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js +0 -387
  506. package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js.map +0 -1
  507. package/build/plugins/resource/function/utils/depsChecker/errors.d.ts +0 -14
  508. package/build/plugins/resource/function/utils/depsChecker/errors.d.ts.map +0 -1
  509. package/build/plugins/resource/function/utils/depsChecker/errors.js +0 -41
  510. package/build/plugins/resource/function/utils/depsChecker/errors.js.map +0 -1
  511. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts +0 -26
  512. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts.map +0 -1
  513. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js +0 -111
  514. package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js.map +0 -1
  515. package/build/plugins/solution/fx-solution/debug/util/certificate.d.ts.map +0 -1
  516. package/build/plugins/solution/fx-solution/debug/util/certificate.js.map +0 -1
  517. package/build/plugins/solution/fx-solution/debug/util/process.d.ts.map +0 -1
  518. package/build/plugins/solution/fx-solution/debug/util/process.js.map +0 -1
  519. package/resource/plugins/resource/function/dotnet-install.ps1 +0 -1095
  520. package/resource/plugins/resource/function/dotnet-install.sh +0 -1222
@@ -1,1222 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Copyright (c) .NET Foundation and contributors. All rights reserved.
3
- # Licensed under the MIT license. See LICENSE file in the project root for full license information.
4
- #
5
-
6
- # Stop script on NZEC
7
- set -e
8
- # Stop script if unbound variable found (use ${var:-} if intentional)
9
- set -u
10
- # By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success
11
- # This is causing it to fail
12
- set -o pipefail
13
-
14
- # Use in the the functions: eval $invocation
15
- invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"'
16
-
17
- # standard output may be used as a return value in the functions
18
- # we need a way to write text on the screen in the functions so that
19
- # it won't interfere with the return value.
20
- # Exposing stream 3 as a pipe to standard output of the script itself
21
- exec 3>&1
22
-
23
- # Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors.
24
- # See if stdout is a terminal
25
- if [ -t 1 ] && command -v tput > /dev/null; then
26
- # see if it supports colors
27
- ncolors=$(tput colors)
28
- if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
29
- bold="$(tput bold || echo)"
30
- normal="$(tput sgr0 || echo)"
31
- black="$(tput setaf 0 || echo)"
32
- red="$(tput setaf 1 || echo)"
33
- green="$(tput setaf 2 || echo)"
34
- yellow="$(tput setaf 3 || echo)"
35
- blue="$(tput setaf 4 || echo)"
36
- magenta="$(tput setaf 5 || echo)"
37
- cyan="$(tput setaf 6 || echo)"
38
- white="$(tput setaf 7 || echo)"
39
- fi
40
- fi
41
-
42
- say_warning() {
43
- printf "%b\n" "${yellow:-}dotnet_install: Warning: $1${normal:-}" >&3
44
- }
45
-
46
- say_err() {
47
- printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2
48
- }
49
-
50
- say() {
51
- # using stream 3 (defined in the beginning) to not interfere with stdout of functions
52
- # which may be used as return value
53
- printf "%b\n" "${cyan:-}dotnet-install:${normal:-} $1" >&3
54
- }
55
-
56
- say_verbose() {
57
- if [ "$verbose" = true ]; then
58
- say "$1"
59
- fi
60
- }
61
-
62
- # This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets,
63
- # then and only then should the Linux distribution appear in this list.
64
- # Adding a Linux distribution to this list does not imply distribution-specific support.
65
- get_legacy_os_name_from_platform() {
66
- eval $invocation
67
-
68
- platform="$1"
69
- case "$platform" in
70
- "centos.7")
71
- echo "centos"
72
- return 0
73
- ;;
74
- "debian.8")
75
- echo "debian"
76
- return 0
77
- ;;
78
- "debian.9")
79
- echo "debian.9"
80
- return 0
81
- ;;
82
- "fedora.23")
83
- echo "fedora.23"
84
- return 0
85
- ;;
86
- "fedora.24")
87
- echo "fedora.24"
88
- return 0
89
- ;;
90
- "fedora.27")
91
- echo "fedora.27"
92
- return 0
93
- ;;
94
- "fedora.28")
95
- echo "fedora.28"
96
- return 0
97
- ;;
98
- "opensuse.13.2")
99
- echo "opensuse.13.2"
100
- return 0
101
- ;;
102
- "opensuse.42.1")
103
- echo "opensuse.42.1"
104
- return 0
105
- ;;
106
- "opensuse.42.3")
107
- echo "opensuse.42.3"
108
- return 0
109
- ;;
110
- "rhel.7"*)
111
- echo "rhel"
112
- return 0
113
- ;;
114
- "ubuntu.14.04")
115
- echo "ubuntu"
116
- return 0
117
- ;;
118
- "ubuntu.16.04")
119
- echo "ubuntu.16.04"
120
- return 0
121
- ;;
122
- "ubuntu.16.10")
123
- echo "ubuntu.16.10"
124
- return 0
125
- ;;
126
- "ubuntu.18.04")
127
- echo "ubuntu.18.04"
128
- return 0
129
- ;;
130
- "alpine.3.4.3")
131
- echo "alpine"
132
- return 0
133
- ;;
134
- esac
135
- return 1
136
- }
137
-
138
- get_linux_platform_name() {
139
- eval $invocation
140
-
141
- if [ -n "$runtime_id" ]; then
142
- echo "${runtime_id%-*}"
143
- return 0
144
- else
145
- if [ -e /etc/os-release ]; then
146
- . /etc/os-release
147
- echo "$ID${VERSION_ID:+.${VERSION_ID}}"
148
- return 0
149
- elif [ -e /etc/redhat-release ]; then
150
- local redhatRelease=$(</etc/redhat-release)
151
- if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux "*" release 6."* ]]; then
152
- echo "rhel.6"
153
- return 0
154
- fi
155
- fi
156
- fi
157
-
158
- say_verbose "Linux specific platform name and version could not be detected: UName = $uname"
159
- return 1
160
- }
161
-
162
- is_musl_based_distro() {
163
- (ldd --version 2>&1 || true) | grep -q musl
164
- }
165
-
166
- get_current_os_name() {
167
- eval $invocation
168
-
169
- local uname=$(uname)
170
- if [ "$uname" = "Darwin" ]; then
171
- echo "osx"
172
- return 0
173
- elif [ "$uname" = "FreeBSD" ]; then
174
- echo "freebsd"
175
- return 0
176
- elif [ "$uname" = "Linux" ]; then
177
- local linux_platform_name
178
- linux_platform_name="$(get_linux_platform_name)" || { echo "linux" && return 0 ; }
179
-
180
- if [ "$linux_platform_name" = "rhel.6" ]; then
181
- echo $linux_platform_name
182
- return 0
183
- elif is_musl_based_distro; then
184
- echo "linux-musl"
185
- return 0
186
- elif [ "$linux_platform_name" = "linux-musl" ]; then
187
- echo "linux-musl"
188
- return 0
189
- else
190
- echo "linux"
191
- return 0
192
- fi
193
- fi
194
-
195
- say_err "OS name could not be detected: UName = $uname"
196
- return 1
197
- }
198
-
199
- get_legacy_os_name() {
200
- eval $invocation
201
-
202
- local uname=$(uname)
203
- if [ "$uname" = "Darwin" ]; then
204
- echo "osx"
205
- return 0
206
- elif [ -n "$runtime_id" ]; then
207
- echo $(get_legacy_os_name_from_platform "${runtime_id%-*}" || echo "${runtime_id%-*}")
208
- return 0
209
- else
210
- if [ -e /etc/os-release ]; then
211
- . /etc/os-release
212
- os=$(get_legacy_os_name_from_platform "$ID${VERSION_ID:+.${VERSION_ID}}" || echo "")
213
- if [ -n "$os" ]; then
214
- echo "$os"
215
- return 0
216
- fi
217
- fi
218
- fi
219
-
220
- say_verbose "Distribution specific OS name and version could not be detected: UName = $uname"
221
- return 1
222
- }
223
-
224
- machine_has() {
225
- eval $invocation
226
-
227
- hash "$1" > /dev/null 2>&1
228
- return $?
229
- }
230
-
231
-
232
- check_min_reqs() {
233
- local hasMinimum=false
234
- if machine_has "curl"; then
235
- hasMinimum=true
236
- elif machine_has "wget"; then
237
- hasMinimum=true
238
- fi
239
-
240
- if [ "$hasMinimum" = "false" ]; then
241
- say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed."
242
- return 1
243
- fi
244
- return 0
245
- }
246
-
247
- # args:
248
- # input - $1
249
- to_lowercase() {
250
- #eval $invocation
251
-
252
- echo "$1" | tr '[:upper:]' '[:lower:]'
253
- return 0
254
- }
255
-
256
- # args:
257
- # input - $1
258
- remove_trailing_slash() {
259
- #eval $invocation
260
-
261
- local input="${1:-}"
262
- echo "${input%/}"
263
- return 0
264
- }
265
-
266
- # args:
267
- # input - $1
268
- remove_beginning_slash() {
269
- #eval $invocation
270
-
271
- local input="${1:-}"
272
- echo "${input#/}"
273
- return 0
274
- }
275
-
276
- # args:
277
- # root_path - $1
278
- # child_path - $2 - this parameter can be empty
279
- combine_paths() {
280
- eval $invocation
281
-
282
- # TODO: Consider making it work with any number of paths. For now:
283
- if [ ! -z "${3:-}" ]; then
284
- say_err "combine_paths: Function takes two parameters."
285
- return 1
286
- fi
287
-
288
- local root_path="$(remove_trailing_slash "$1")"
289
- local child_path="$(remove_beginning_slash "${2:-}")"
290
- say_verbose "combine_paths: root_path=$root_path"
291
- say_verbose "combine_paths: child_path=$child_path"
292
- echo "$root_path/$child_path"
293
- return 0
294
- }
295
-
296
- get_machine_architecture() {
297
- eval $invocation
298
-
299
- if command -v uname > /dev/null; then
300
- CPUName=$(uname -m)
301
- case $CPUName in
302
- armv*l)
303
- echo "arm"
304
- return 0
305
- ;;
306
- aarch64|arm64)
307
- echo "arm64"
308
- return 0
309
- ;;
310
- esac
311
- fi
312
-
313
- # Always default to 'x64'
314
- echo "x64"
315
- return 0
316
- }
317
-
318
- # args:
319
- # architecture - $1
320
- get_normalized_architecture_from_architecture() {
321
- eval $invocation
322
-
323
- local architecture="$(to_lowercase "$1")"
324
- case "$architecture" in
325
- \<auto\>)
326
- echo "$(get_normalized_architecture_from_architecture "$(get_machine_architecture)")"
327
- return 0
328
- ;;
329
- amd64|x64)
330
- echo "x64"
331
- return 0
332
- ;;
333
- arm)
334
- echo "arm"
335
- return 0
336
- ;;
337
- arm64)
338
- echo "arm64"
339
- return 0
340
- ;;
341
- esac
342
-
343
- say_err "Architecture \`$architecture\` not supported. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues"
344
- return 1
345
- }
346
-
347
- # args:
348
- # user_defined_os - $1
349
- get_normalized_os() {
350
- eval $invocation
351
-
352
- local osname="$(to_lowercase "$1")"
353
- if [ ! -z "$osname" ]; then
354
- case "$osname" in
355
- osx | freebsd | rhel.6 | linux-musl | linux)
356
- echo "$osname"
357
- return 0
358
- ;;
359
- *)
360
- say_err "'$user_defined_os' is not a supported value for --os option, supported values are: osx, linux, linux-musl, freebsd, rhel.6. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
361
- return 1
362
- ;;
363
- esac
364
- else
365
- osname="$(get_current_os_name)" || return 1
366
- fi
367
- echo "$osname"
368
- return 0
369
- }
370
-
371
- # The version text returned from the feeds is a 1-line or 2-line string:
372
- # For the SDK and the dotnet runtime (2 lines):
373
- # Line 1: # commit_hash
374
- # Line 2: # 4-part version
375
- # For the aspnetcore runtime (1 line):
376
- # Line 1: # 4-part version
377
-
378
- # args:
379
- # version_text - stdin
380
- get_version_from_version_info() {
381
- eval $invocation
382
-
383
- cat | tail -n 1 | sed 's/\r$//'
384
- return 0
385
- }
386
-
387
- # args:
388
- # install_root - $1
389
- # relative_path_to_package - $2
390
- # specific_version - $3
391
- is_dotnet_package_installed() {
392
- eval $invocation
393
-
394
- local install_root="$1"
395
- local relative_path_to_package="$2"
396
- local specific_version="${3//[$'\t\r\n']}"
397
-
398
- local dotnet_package_path="$(combine_paths "$(combine_paths "$install_root" "$relative_path_to_package")" "$specific_version")"
399
- say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path"
400
-
401
- if [ -d "$dotnet_package_path" ]; then
402
- return 0
403
- else
404
- return 1
405
- fi
406
- }
407
-
408
- # args:
409
- # azure_feed - $1
410
- # channel - $2
411
- # normalized_architecture - $3
412
- get_latest_version_info() {
413
- eval $invocation
414
-
415
- local azure_feed="$1"
416
- local channel="$2"
417
- local normalized_architecture="$3"
418
-
419
- local version_file_url=null
420
- if [[ "$runtime" == "dotnet" ]]; then
421
- version_file_url="$uncached_feed/Runtime/$channel/latest.version"
422
- elif [[ "$runtime" == "aspnetcore" ]]; then
423
- version_file_url="$uncached_feed/aspnetcore/Runtime/$channel/latest.version"
424
- elif [ -z "$runtime" ]; then
425
- version_file_url="$uncached_feed/Sdk/$channel/latest.version"
426
- else
427
- say_err "Invalid value for \$runtime"
428
- return 1
429
- fi
430
- say_verbose "get_latest_version_info: latest url: $version_file_url"
431
-
432
- download "$version_file_url"
433
- return $?
434
- }
435
-
436
- # args:
437
- # json_file - $1
438
- parse_jsonfile_for_version() {
439
- eval $invocation
440
-
441
- local json_file="$1"
442
- if [ ! -f "$json_file" ]; then
443
- say_err "Unable to find \`$json_file\`"
444
- return 1
445
- fi
446
-
447
- sdk_section=$(cat $json_file | awk '/"sdk"/,/}/')
448
- if [ -z "$sdk_section" ]; then
449
- say_err "Unable to parse the SDK node in \`$json_file\`"
450
- return 1
451
- fi
452
-
453
- sdk_list=$(echo $sdk_section | awk -F"[{}]" '{print $2}')
454
- sdk_list=${sdk_list//[\" ]/}
455
- sdk_list=${sdk_list//,/$'\n'}
456
-
457
- local version_info=""
458
- while read -r line; do
459
- IFS=:
460
- while read -r key value; do
461
- if [[ "$key" == "version" ]]; then
462
- version_info=$value
463
- fi
464
- done <<< "$line"
465
- done <<< "$sdk_list"
466
- if [ -z "$version_info" ]; then
467
- say_err "Unable to find the SDK:version node in \`$json_file\`"
468
- return 1
469
- fi
470
-
471
- unset IFS;
472
- echo "$version_info"
473
- return 0
474
- }
475
-
476
- # args:
477
- # azure_feed - $1
478
- # channel - $2
479
- # normalized_architecture - $3
480
- # version - $4
481
- # json_file - $5
482
- get_specific_version_from_version() {
483
- eval $invocation
484
-
485
- local azure_feed="$1"
486
- local channel="$2"
487
- local normalized_architecture="$3"
488
- local version="$(to_lowercase "$4")"
489
- local json_file="$5"
490
-
491
- if [ -z "$json_file" ]; then
492
- if [[ "$version" == "latest" ]]; then
493
- local version_info
494
- version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1
495
- say_verbose "get_specific_version_from_version: version_info=$version_info"
496
- echo "$version_info" | get_version_from_version_info
497
- return 0
498
- else
499
- echo "$version"
500
- return 0
501
- fi
502
- else
503
- local version_info
504
- version_info="$(parse_jsonfile_for_version "$json_file")" || return 1
505
- echo "$version_info"
506
- return 0
507
- fi
508
- }
509
-
510
- # args:
511
- # azure_feed - $1
512
- # channel - $2
513
- # normalized_architecture - $3
514
- # specific_version - $4
515
- # normalized_os - $5
516
- construct_download_link() {
517
- eval $invocation
518
-
519
- local azure_feed="$1"
520
- local channel="$2"
521
- local normalized_architecture="$3"
522
- local specific_version="${4//[$'\t\r\n']}"
523
- local specific_product_version="$(get_specific_product_version "$1" "$4")"
524
- local osname="$5"
525
-
526
- local download_link=null
527
- if [[ "$runtime" == "dotnet" ]]; then
528
- download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz"
529
- elif [[ "$runtime" == "aspnetcore" ]]; then
530
- download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz"
531
- elif [ -z "$runtime" ]; then
532
- download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_product_version-$osname-$normalized_architecture.tar.gz"
533
- else
534
- return 1
535
- fi
536
-
537
- echo "$download_link"
538
- return 0
539
- }
540
-
541
- # args:
542
- # azure_feed - $1
543
- # specific_version - $2
544
- get_specific_product_version() {
545
- # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents
546
- # to resolve the version of what's in the folder, superseding the specified version.
547
- eval $invocation
548
-
549
- local azure_feed="$1"
550
- local specific_version="${2//[$'\t\r\n']}"
551
- local specific_product_version=$specific_version
552
-
553
- local download_link=null
554
- if [[ "$runtime" == "dotnet" ]]; then
555
- download_link="$azure_feed/Runtime/$specific_version/productVersion.txt${feed_credential}"
556
- elif [[ "$runtime" == "aspnetcore" ]]; then
557
- download_link="$azure_feed/aspnetcore/Runtime/$specific_version/productVersion.txt${feed_credential}"
558
- elif [ -z "$runtime" ]; then
559
- download_link="$azure_feed/Sdk/$specific_version/productVersion.txt${feed_credential}"
560
- else
561
- return 1
562
- fi
563
-
564
- if machine_has "curl"
565
- then
566
- specific_product_version=$(curl -s --fail "$download_link")
567
- if [ $? -ne 0 ]
568
- then
569
- specific_product_version=$specific_version
570
- fi
571
- elif machine_has "wget"
572
- then
573
- specific_product_version=$(wget -qO- "$download_link")
574
- if [ $? -ne 0 ]
575
- then
576
- specific_product_version=$specific_version
577
- fi
578
- fi
579
- specific_product_version="${specific_product_version//[$'\t\r\n']}"
580
-
581
- echo "$specific_product_version"
582
- return 0
583
- }
584
-
585
- # args:
586
- # azure_feed - $1
587
- # channel - $2
588
- # normalized_architecture - $3
589
- # specific_version - $4
590
- construct_legacy_download_link() {
591
- eval $invocation
592
-
593
- local azure_feed="$1"
594
- local channel="$2"
595
- local normalized_architecture="$3"
596
- local specific_version="${4//[$'\t\r\n']}"
597
-
598
- local distro_specific_osname
599
- distro_specific_osname="$(get_legacy_os_name)" || return 1
600
-
601
- local legacy_download_link=null
602
- if [[ "$runtime" == "dotnet" ]]; then
603
- legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
604
- elif [ -z "$runtime" ]; then
605
- legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
606
- else
607
- return 1
608
- fi
609
-
610
- echo "$legacy_download_link"
611
- return 0
612
- }
613
-
614
- get_user_install_path() {
615
- eval $invocation
616
-
617
- if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then
618
- echo "$DOTNET_INSTALL_DIR"
619
- else
620
- echo "$HOME/.dotnet"
621
- fi
622
- return 0
623
- }
624
-
625
- # args:
626
- # install_dir - $1
627
- resolve_installation_path() {
628
- eval $invocation
629
-
630
- local install_dir=$1
631
- if [ "$install_dir" = "<auto>" ]; then
632
- local user_install_path="$(get_user_install_path)"
633
- say_verbose "resolve_installation_path: user_install_path=$user_install_path"
634
- echo "$user_install_path"
635
- return 0
636
- fi
637
-
638
- echo "$install_dir"
639
- return 0
640
- }
641
-
642
- # args:
643
- # relative_or_absolute_path - $1
644
- get_absolute_path() {
645
- eval $invocation
646
-
647
- local relative_or_absolute_path=$1
648
- echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")"
649
- return 0
650
- }
651
-
652
- # args:
653
- # input_files - stdin
654
- # root_path - $1
655
- # out_path - $2
656
- # override - $3
657
- copy_files_or_dirs_from_list() {
658
- eval $invocation
659
-
660
- local root_path="$(remove_trailing_slash "$1")"
661
- local out_path="$(remove_trailing_slash "$2")"
662
- local override="$3"
663
- local osname="$(get_current_os_name)"
664
- local override_switch=$(
665
- if [ "$override" = false ]; then
666
- if [ "$osname" = "linux-musl" ]; then
667
- printf -- "-u";
668
- else
669
- printf -- "-n";
670
- fi
671
- fi)
672
-
673
- cat | uniq | while read -r file_path; do
674
- local path="$(remove_beginning_slash "${file_path#$root_path}")"
675
- local target="$out_path/$path"
676
- if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then
677
- mkdir -p "$out_path/$(dirname "$path")"
678
- if [ -d "$target" ]; then
679
- rm -rf "$target"
680
- fi
681
- cp -R $override_switch "$root_path/$path" "$target"
682
- fi
683
- done
684
- }
685
-
686
- # args:
687
- # zip_path - $1
688
- # out_path - $2
689
- extract_dotnet_package() {
690
- eval $invocation
691
-
692
- local zip_path="$1"
693
- local out_path="$2"
694
-
695
- local temp_out_path="$(mktemp -d "$temporary_file_template")"
696
-
697
- local failed=false
698
- tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true
699
-
700
- local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/'
701
- find "$temp_out_path" -type f | grep -Eo "$folders_with_version_regex" | sort | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" false
702
- find "$temp_out_path" -type f | grep -Ev "$folders_with_version_regex" | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" "$override_non_versioned_files"
703
-
704
- rm -rf "$temp_out_path"
705
- rm -f "$zip_path" && say_verbose "Temporary zip file $zip_path was removed"
706
-
707
- if [ "$failed" = true ]; then
708
- say_err "Extraction failed"
709
- return 1
710
- fi
711
- return 0
712
- }
713
-
714
- get_http_header_curl() {
715
- eval $invocation
716
- local remote_path="$1"
717
- remote_path_with_credential="${remote_path}${feed_credential}"
718
- curl_options="-I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 "
719
- curl $curl_options "$remote_path_with_credential" || return 1
720
- return 0
721
- }
722
-
723
- get_http_header_wget() {
724
- eval $invocation
725
- local remote_path="$1"
726
- remote_path_with_credential="${remote_path}${feed_credential}"
727
- wget_options="-q -S --spider --tries 5 --waitretry 2 --connect-timeout 15 "
728
- wget $wget_options "$remote_path_with_credential" 2>&1 || return 1
729
- return 0
730
- }
731
-
732
- # args:
733
- # remote_path - $1
734
- # [out_path] - $2 - stdout if not provided
735
- download() {
736
- eval $invocation
737
-
738
- local remote_path="$1"
739
- local out_path="${2:-}"
740
-
741
- if [[ "$remote_path" != "http"* ]]; then
742
- cp "$remote_path" "$out_path"
743
- return $?
744
- fi
745
-
746
- local failed=false
747
- local attempts=0
748
- while [ $attempts -lt 3 ]; do
749
- attempts=$((attempts+1))
750
- failed=false
751
- if machine_has "curl"; then
752
- downloadcurl "$remote_path" "$out_path" || failed=true
753
- elif machine_has "wget"; then
754
- downloadwget "$remote_path" "$out_path" || failed=true
755
- else
756
- say_err "Missing dependency: neither curl nor wget was found."
757
- exit 1
758
- fi
759
-
760
- if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then
761
- break
762
- fi
763
-
764
- say "Download attempt #$attempts has failed: $http_code $download_error_msg"
765
- say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds."
766
- sleep $((attempts*20))
767
- done
768
-
769
-
770
-
771
- if [ "$failed" = true ]; then
772
- say_verbose "Download failed: $remote_path"
773
- return 1
774
- fi
775
- return 0
776
- }
777
-
778
- # Updates global variables $http_code and $download_error_msg
779
- downloadcurl() {
780
- eval $invocation
781
- unset http_code
782
- unset download_error_msg
783
- local remote_path="$1"
784
- local out_path="${2:-}"
785
- # Append feed_credential as late as possible before calling curl to avoid logging feed_credential
786
- local remote_path_with_credential="${remote_path}${feed_credential}"
787
- local curl_options="--retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs "
788
- local failed=false
789
- if [ -z "$out_path" ]; then
790
- curl $curl_options "$remote_path_with_credential" || failed=true
791
- else
792
- curl $curl_options -o "$out_path" "$remote_path_with_credential" || failed=true
793
- fi
794
- if [ "$failed" = true ]; then
795
- local response=$(get_http_header_curl $remote_path_with_credential)
796
- http_code=$( echo "$response" | awk '/^HTTP/{print $2}' | tail -1 )
797
- download_error_msg="Unable to download $remote_path."
798
- if [[ $http_code != 2* ]]; then
799
- download_error_msg+=" Returned HTTP status code: $http_code."
800
- fi
801
- say_verbose "$download_error_msg"
802
- return 1
803
- fi
804
- return 0
805
- }
806
-
807
-
808
- # Updates global variables $http_code and $download_error_msg
809
- downloadwget() {
810
- eval $invocation
811
- unset http_code
812
- unset download_error_msg
813
- local remote_path="$1"
814
- local out_path="${2:-}"
815
- # Append feed_credential as late as possible before calling wget to avoid logging feed_credential
816
- local remote_path_with_credential="${remote_path}${feed_credential}"
817
- local wget_options="--tries 20 --waitretry 2 --connect-timeout 15 "
818
- local failed=false
819
- if [ -z "$out_path" ]; then
820
- wget -q $wget_options -O - "$remote_path_with_credential" || failed=true
821
- else
822
- wget $wget_options -O "$out_path" "$remote_path_with_credential" || failed=true
823
- fi
824
- if [ "$failed" = true ]; then
825
- local response=$(get_http_header_wget $remote_path_with_credential)
826
- http_code=$( echo "$response" | awk '/^ HTTP/{print $2}' | tail -1 )
827
- download_error_msg="Unable to download $remote_path."
828
- if [[ $http_code != 2* ]]; then
829
- download_error_msg+=" Returned HTTP status code: $http_code."
830
- fi
831
- say_verbose "$download_error_msg"
832
- return 1
833
- fi
834
- return 0
835
- }
836
-
837
- calculate_vars() {
838
- eval $invocation
839
- valid_legacy_download_link=true
840
-
841
- normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")"
842
- say_verbose "normalized_architecture=$normalized_architecture"
843
-
844
- normalized_os="$(get_normalized_os "$user_defined_os")"
845
- say_verbose "normalized_os=$normalized_os"
846
-
847
- specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version" "$json_file")"
848
- specific_product_version="$(get_specific_product_version "$azure_feed" "$specific_version")"
849
- say_verbose "specific_version=$specific_version"
850
- if [ -z "$specific_version" ]; then
851
- say_err "Could not resolve version information."
852
- return 1
853
- fi
854
-
855
- download_link="$(construct_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version" "$normalized_os")"
856
- say_verbose "Constructed primary named payload URL: $download_link"
857
-
858
- legacy_download_link="$(construct_legacy_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" || valid_legacy_download_link=false
859
-
860
- if [ "$valid_legacy_download_link" = true ]; then
861
- say_verbose "Constructed legacy named payload URL: $legacy_download_link"
862
- else
863
- say_verbose "Cound not construct a legacy_download_link; omitting..."
864
- fi
865
-
866
- install_root="$(resolve_installation_path "$install_dir")"
867
- say_verbose "InstallRoot: $install_root"
868
- }
869
-
870
- install_dotnet() {
871
- eval $invocation
872
- local download_failed=false
873
- local asset_name=''
874
- local asset_relative_path=''
875
-
876
- if [[ "$runtime" == "dotnet" ]]; then
877
- asset_relative_path="shared/Microsoft.NETCore.App"
878
- asset_name=".NET Core Runtime"
879
- elif [[ "$runtime" == "aspnetcore" ]]; then
880
- asset_relative_path="shared/Microsoft.AspNetCore.App"
881
- asset_name="ASP.NET Core Runtime"
882
- elif [ -z "$runtime" ]; then
883
- asset_relative_path="sdk"
884
- asset_name=".NET Core SDK"
885
- else
886
- say_err "Invalid value for \$runtime"
887
- return 1
888
- fi
889
-
890
- # Check if the SDK version is already installed.
891
- if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then
892
- say "$asset_name version $specific_version is already installed."
893
- return 0
894
- fi
895
-
896
- mkdir -p "$install_root"
897
- zip_path="$(mktemp "$temporary_file_template")"
898
- say_verbose "Zip path: $zip_path"
899
-
900
-
901
- # Failures are normal in the non-legacy case for ultimately legacy downloads.
902
- # Do not output to stderr, since output to stderr is considered an error.
903
- say "Downloading primary link $download_link"
904
-
905
- # The download function will set variables $http_code and $download_error_msg in case of failure.
906
- download "$download_link" "$zip_path" 2>&1 || download_failed=true
907
-
908
- # if the download fails, download the legacy_download_link
909
- if [ "$download_failed" = true ]; then
910
- primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg"
911
- case $primary_path_http_code in
912
- 404)
913
- say "The resource at $download_link is not available."
914
- ;;
915
- *)
916
- say "$primary_path_download_error_msg"
917
- ;;
918
- esac
919
- rm -f "$zip_path" 2>&1 && say_verbose "Temporary zip file $zip_path was removed"
920
- if [ "$valid_legacy_download_link" = true ]; then
921
- download_failed=false
922
- download_link="$legacy_download_link"
923
- zip_path="$(mktemp "$temporary_file_template")"
924
- say_verbose "Legacy zip path: $zip_path"
925
-
926
- say "Downloading legacy link $download_link"
927
-
928
- # The download function will set variables $http_code and $download_error_msg in case of failure.
929
- download "$download_link" "$zip_path" 2>&1 || download_failed=true
930
-
931
- if [ "$download_failed" = true ]; then
932
- legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg"
933
- case $legacy_path_http_code in
934
- 404)
935
- say "The resource at $download_link is not available."
936
- ;;
937
- *)
938
- say "$legacy_path_download_error_msg"
939
- ;;
940
- esac
941
- rm -f "$zip_path" 2>&1 && say_verbose "Temporary zip file $zip_path was removed"
942
- fi
943
- fi
944
- fi
945
-
946
- if [ "$download_failed" = true ]; then
947
- if [[ "$primary_path_http_code" = "404" && ( "$valid_legacy_download_link" = false || "$legacy_path_http_code" = "404") ]]; then
948
- say_err "Could not find \`$asset_name\` with version = $specific_version"
949
- say_err "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support"
950
- else
951
- say_err "Could not download: \`$asset_name\` with version = $specific_version"
952
- # 404-NotFound is an expected response if it goes from only one of the links, do not show that error.
953
- # If primary path is available (not 404-NotFound) then show the primary error else show the legacy error.
954
- if [ "$primary_path_http_code" != "404" ]; then
955
- say_err "$primary_path_download_error_msg"
956
- return 1
957
- fi
958
- if [[ "$valid_legacy_download_link" = true && "$legacy_path_http_code" != "404" ]]; then
959
- say_err "$legacy_path_download_error_msg"
960
- return 1
961
- fi
962
- fi
963
- return 1
964
- fi
965
-
966
- say "Extracting zip from $download_link"
967
- extract_dotnet_package "$zip_path" "$install_root" || return 1
968
-
969
- # Check if the SDK version is installed; if not, fail the installation.
970
- # if the version contains "RTM" or "servicing"; check if a 'release-type' SDK version is installed.
971
- if [[ $specific_version == *"rtm"* || $specific_version == *"servicing"* ]]; then
972
- IFS='-'
973
- read -ra verArr <<< "$specific_version"
974
- release_version="${verArr[0]}"
975
- unset IFS;
976
- say_verbose "Checking installation: version = $release_version"
977
- if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$release_version"; then
978
- return 0
979
- fi
980
- fi
981
-
982
- # Check if the standard SDK version is installed.
983
- say_verbose "Checking installation: version = $specific_product_version"
984
- if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_product_version"; then
985
- return 0
986
- fi
987
-
988
- # Version verification failed. More likely something is wrong either with the downloaded content or with the verification algorithm.
989
- say_err "Failed to verify the version of installed \`$asset_name\`.\nInstallation source: $download_link.\nInstallation location: $install_root.\nReport the bug at https://github.com/dotnet/install-scripts/issues."
990
- say_err "\`$asset_name\` with version = $specific_product_version failed to install with an unknown error."
991
- return 1
992
- }
993
-
994
- args=("$@")
995
-
996
- local_version_file_relative_path="/.version"
997
- bin_folder_relative_path=""
998
- temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX"
999
-
1000
- channel="LTS"
1001
- version="Latest"
1002
- json_file=""
1003
- install_dir="<auto>"
1004
- architecture="<auto>"
1005
- dry_run=false
1006
- no_path=false
1007
- no_cdn=false
1008
- azure_feed="https://dotnetcli.azureedge.net/dotnet"
1009
- uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet"
1010
- feed_credential=""
1011
- verbose=false
1012
- runtime=""
1013
- runtime_id=""
1014
- override_non_versioned_files=true
1015
- non_dynamic_parameters=""
1016
- user_defined_os=""
1017
-
1018
- while [ $# -ne 0 ]
1019
- do
1020
- name="$1"
1021
- case "$name" in
1022
- -c|--channel|-[Cc]hannel)
1023
- shift
1024
- channel="$1"
1025
- ;;
1026
- -v|--version|-[Vv]ersion)
1027
- shift
1028
- version="$1"
1029
- ;;
1030
- -i|--install-dir|-[Ii]nstall[Dd]ir)
1031
- shift
1032
- install_dir="$1"
1033
- ;;
1034
- --arch|--architecture|-[Aa]rch|-[Aa]rchitecture)
1035
- shift
1036
- architecture="$1"
1037
- ;;
1038
- --os|-[Oo][SS])
1039
- shift
1040
- user_defined_os="$1"
1041
- ;;
1042
- --shared-runtime|-[Ss]hared[Rr]untime)
1043
- say_warning "The --shared-runtime flag is obsolete and may be removed in a future version of this script. The recommended usage is to specify '--runtime dotnet'."
1044
- if [ -z "$runtime" ]; then
1045
- runtime="dotnet"
1046
- fi
1047
- ;;
1048
- --runtime|-[Rr]untime)
1049
- shift
1050
- runtime="$1"
1051
- if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then
1052
- say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'."
1053
- if [[ "$runtime" == "windowsdesktop" ]]; then
1054
- say_err "WindowsDesktop archives are manufactured for Windows platforms only."
1055
- fi
1056
- exit 1
1057
- fi
1058
- ;;
1059
- --dry-run|-[Dd]ry[Rr]un)
1060
- dry_run=true
1061
- ;;
1062
- --no-path|-[Nn]o[Pp]ath)
1063
- no_path=true
1064
- non_dynamic_parameters+=" $name"
1065
- ;;
1066
- --verbose|-[Vv]erbose)
1067
- verbose=true
1068
- non_dynamic_parameters+=" $name"
1069
- ;;
1070
- --no-cdn|-[Nn]o[Cc]dn)
1071
- no_cdn=true
1072
- non_dynamic_parameters+=" $name"
1073
- ;;
1074
- --azure-feed|-[Aa]zure[Ff]eed)
1075
- shift
1076
- azure_feed="$1"
1077
- non_dynamic_parameters+=" $name "\""$1"\"""
1078
- ;;
1079
- --uncached-feed|-[Uu]ncached[Ff]eed)
1080
- shift
1081
- uncached_feed="$1"
1082
- non_dynamic_parameters+=" $name "\""$1"\"""
1083
- ;;
1084
- --feed-credential|-[Ff]eed[Cc]redential)
1085
- shift
1086
- feed_credential="$1"
1087
- non_dynamic_parameters+=" $name "\""$1"\"""
1088
- ;;
1089
- --runtime-id|-[Rr]untime[Ii]d)
1090
- shift
1091
- runtime_id="$1"
1092
- non_dynamic_parameters+=" $name "\""$1"\"""
1093
- say_warning "Use of --runtime-id is obsolete and should be limited to the versions below 2.1. To override architecture, use --architecture option instead. To override OS, use --os option instead."
1094
- ;;
1095
- --jsonfile|-[Jj][Ss]on[Ff]ile)
1096
- shift
1097
- json_file="$1"
1098
- ;;
1099
- --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles)
1100
- override_non_versioned_files=false
1101
- non_dynamic_parameters+=" $name"
1102
- ;;
1103
- -?|--?|-h|--help|-[Hh]elp)
1104
- script_name="$(basename "$0")"
1105
- echo ".NET Tools Installer"
1106
- echo "Usage: $script_name [-c|--channel <CHANNEL>] [-v|--version <VERSION>] [-p|--prefix <DESTINATION>]"
1107
- echo " $script_name -h|-?|--help"
1108
- echo ""
1109
- echo "$script_name is a simple command line interface for obtaining dotnet cli."
1110
- echo ""
1111
- echo "Options:"
1112
- echo " -c,--channel <CHANNEL> Download from the channel specified, Defaults to \`$channel\`."
1113
- echo " -Channel"
1114
- echo " Possible values:"
1115
- echo " - Current - most current release"
1116
- echo " - LTS - most current supported release"
1117
- echo " - 2-part version in a format A.B - represents a specific release"
1118
- echo " examples: 2.0; 1.0"
1119
- echo " - Branch name"
1120
- echo " examples: release/2.0.0; Master"
1121
- echo " Note: The version parameter overrides the channel parameter."
1122
- echo " -v,--version <VERSION> Use specific VERSION, Defaults to \`$version\`."
1123
- echo " -Version"
1124
- echo " Possible values:"
1125
- echo " - latest - most latest build on specific channel"
1126
- echo " - 3-part version in a format A.B.C - represents specific version of build"
1127
- echo " examples: 2.0.0-preview2-006120; 1.1.0"
1128
- echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
1129
- echo " -InstallDir"
1130
- echo " --architecture <ARCHITECTURE> Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`."
1131
- echo " --arch,-Architecture,-Arch"
1132
- echo " Possible values: x64, arm, and arm64"
1133
- echo " --os <system> Specifies operating system to be used when selecting the installer."
1134
- echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6."
1135
- echo " In case any other value is provided, the platform will be determined by the script based on machine configuration."
1136
- echo " Not supported for legacy links. Use --runtime-id to specify platform for legacy links."
1137
- echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information."
1138
- echo " --runtime <RUNTIME> Installs a shared runtime only, without the SDK."
1139
- echo " -Runtime"
1140
- echo " Possible values:"
1141
- echo " - dotnet - the Microsoft.NETCore.App shared runtime"
1142
- echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime"
1143
- echo " --dry-run,-DryRun Do not perform installation. Display download link."
1144
- echo " --no-path, -NoPath Do not set PATH for the current process."
1145
- echo " --verbose,-Verbose Display diagnostics information."
1146
- echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user."
1147
- echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user."
1148
- echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified."
1149
- echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
1150
- echo " -SkipNonVersionedFiles"
1151
- echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
1152
- echo " --jsonfile <JSONFILE> Determines the SDK version from a user specified global.json file."
1153
- echo " Note: global.json must have a value for 'SDK:Version'"
1154
- echo " -?,--?,-h,--help,-Help Shows this help message"
1155
- echo ""
1156
- echo "Obsolete parameters:"
1157
- echo " --shared-runtime The recommended alternative is '--runtime dotnet'."
1158
- echo " This parameter is obsolete and may be removed in a future version of this script."
1159
- echo " Installs just the shared runtime bits, not the entire SDK."
1160
- echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)."
1161
- echo " -RuntimeId" The parameter is obsolete and may be removed in a future version of this script. Should be used only for versions below 2.1.
1162
- echo " For primary links to override OS or/and architecture, use --os and --architecture option instead."
1163
- echo ""
1164
- echo "Install Location:"
1165
- echo " Location is chosen in following order:"
1166
- echo " - --install-dir option"
1167
- echo " - Environmental variable DOTNET_INSTALL_DIR"
1168
- echo " - $HOME/.dotnet"
1169
- exit 0
1170
- ;;
1171
- *)
1172
- say_err "Unknown argument \`$name\`"
1173
- exit 1
1174
- ;;
1175
- esac
1176
-
1177
- shift
1178
- done
1179
-
1180
- if [ "$no_cdn" = true ]; then
1181
- azure_feed="$uncached_feed"
1182
- fi
1183
-
1184
- say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:"
1185
- say "- The SDK needs to be installed without user interaction and without admin rights."
1186
- say "- The SDK installation doesn't need to persist across multiple CI runs."
1187
- say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n"
1188
-
1189
- check_min_reqs
1190
- calculate_vars
1191
- script_name=$(basename "$0")
1192
-
1193
- if [ "$dry_run" = true ]; then
1194
- say "Payload URLs:"
1195
- say "Primary named payload URL: $download_link"
1196
- if [ "$valid_legacy_download_link" = true ]; then
1197
- say "Legacy named payload URL: $legacy_download_link"
1198
- fi
1199
- repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\"""
1200
- if [[ "$runtime" == "dotnet" ]]; then
1201
- repeatable_command+=" --runtime "\""dotnet"\"""
1202
- elif [[ "$runtime" == "aspnetcore" ]]; then
1203
- repeatable_command+=" --runtime "\""aspnetcore"\"""
1204
- fi
1205
- repeatable_command+="$non_dynamic_parameters"
1206
- say "Repeatable invocation: $repeatable_command"
1207
- exit 0
1208
- fi
1209
-
1210
- install_dotnet
1211
-
1212
- bin_path="$(get_absolute_path "$(combine_paths "$install_root" "$bin_folder_relative_path")")"
1213
- if [ "$no_path" = false ]; then
1214
- say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script."
1215
- export PATH="$bin_path":"$PATH"
1216
- else
1217
- say "Binaries of dotnet can be found in $bin_path"
1218
- fi
1219
-
1220
- say "Note that the script does not resolve dependencies during installation."
1221
- say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section."
1222
- say "Installation finished successfully."