adapt-cli 3.1.3 → 3.1.4
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.
@@ -3,6 +3,7 @@ import getBowerRegistryConfig from '../getBowerRegistryConfig.js'
|
|
3
3
|
import fs from 'fs-extra'
|
4
4
|
import path from 'path'
|
5
5
|
import bower from 'bower'
|
6
|
+
import fetch from 'node-fetch'
|
6
7
|
import chalk from 'chalk'
|
7
8
|
import inquirer from 'inquirer'
|
8
9
|
import { readValidateJSON } from '../../util/JSONReadValidate.js'
|
@@ -120,11 +121,18 @@ async function exists (BOWER_REGISTRY_CONFIG, plugin) {
|
|
120
121
|
}
|
121
122
|
|
122
123
|
async function registerWithBowerRepo (BOWER_REGISTRY_CONFIG, plugin, repository) {
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
124
|
+
const data = {
|
125
|
+
name: plugin.toString(),
|
126
|
+
url: repository.url || repository
|
127
|
+
}
|
128
|
+
const response = await fetch(`${BOWER_REGISTRY_CONFIG.register}packages`, {
|
129
|
+
headers: {
|
130
|
+
'User-Agent': 'adapt-cli',
|
131
|
+
'Content-Type': 'application/json'
|
132
|
+
},
|
133
|
+
followRedirect: false,
|
134
|
+
method: 'POST',
|
135
|
+
body: JSON.stringify(data)
|
129
136
|
})
|
137
|
+
return (response?.status === 201)
|
130
138
|
}
|