@splitmedialabs/devctl
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "@splitmedialabs/devctl", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Makara Sok", | ||
@@ -5,0 +5,0 @@ "description": "Easily start developing in monorepos with docker-compose", |
@@ -44,3 +44,7 @@ const { cosmiconfig } = require('cosmiconfig'); | ||
project.current = await readYaml(paths.current); | ||
try { | ||
project.current = await readYaml(paths.current); | ||
} catch (err) { | ||
project.current = {}; | ||
} | ||
@@ -47,0 +51,0 @@ return project; |
@@ -50,3 +50,3 @@ const os = require('os'); | ||
async function isIpReachableInsideDocker(ip, port) { | ||
const container = await docker.run(DOCKER_CURL, [ | ||
const [output] = await docker.run(DOCKER_CURL, [ | ||
'curl', | ||
@@ -58,3 +58,3 @@ '-m', | ||
return container.output.StatusCode === 0; | ||
return get(output, 'StatusCode') === 0; | ||
} | ||
@@ -89,5 +89,8 @@ | ||
const ips = await Promise.map(listDeviceIps(), async ip => { | ||
ip.reachable = await isIpReachableInsideDocker(ip.address, port); | ||
const reachable = await isIpReachableInsideDocker(ip.address, port); | ||
return ip; | ||
return { | ||
...ip, | ||
reachable, | ||
}; | ||
}).filter(ip => ip.reachable); | ||
@@ -98,11 +101,12 @@ | ||
const ip = get(ips, [0]); | ||
const address = get(ip, 'address'); | ||
print.info( | ||
`${print.colors.success( | ||
'✔' | ||
)} IP Reachable from inside Docker found: ${print.colors.warning( | ||
ips[0].address | ||
)}.` | ||
)} IP Reachable from inside Docker found: ${print.colors.warning(address)}.` | ||
); | ||
return ips[0]; | ||
return ip; | ||
} | ||
@@ -109,0 +113,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33542
931