Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create more appealing visual space for local and remote text #28

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/services/new-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class NewService {
new AppendToDockerignoreService().run()
new AppendToGitignoreService().run()

this.cmd.log('local:')
this.cmd.log('local: ')

if (this.existingEnv) {
this._logExistingEnv()
Expand Down Expand Up @@ -70,21 +70,21 @@ class NewService {
}

_logExistingEnv(): void {
this.cmd.log('local: Existing .env')
this.cmd.log('local: Existing .env')
}

_logCreatingEnv(): void {
this.cmd.log('local: Creating .env')
this.cmd.log('local: Creating .env')
}

_logExistingEnvProject(): void {
this.cmd.log('local: Existing .env.project')
this.cmd.log('local:')
this.cmd.log('local: Existing .env.project')
this.cmd.log('local: ')
}

_logCreatingEnvProject(): void {
this.cmd.log('local: Creating .env.project')
this.cmd.log('local:')
this.cmd.log('local: Creating .env.project')
this.cmd.log('local: ')
}

_writeEnv(): void {
Expand All @@ -102,9 +102,9 @@ class NewService {
}

_logProTip(): void {
this.cmd.log('local:')
this.cmd.log('local: 💡ProTip! The .env.project file securely identifies your project at Dotenv Vault')
this.cmd.log('local:')
this.cmd.log('local: ')
this.cmd.log('local: 💡ProTip! The .env.project file securely identifies your project at Dotenv Vault')
this.cmd.log('local: ')
}

_logCompleted(): void {
Expand Down
28 changes: 14 additions & 14 deletions src/services/pull-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class PullService {
}

_logCheckingForEnvProject(): void {
this.cmd.log('local:')
this.cmd.log('local: Checking for .env.project')
this.cmd.log('local: ')
this.cmd.log('local: Checking for .env.project')
}

_logMissingEnvProject(): void {
Expand All @@ -127,20 +127,20 @@ class PullService {
}

_logCheckingForEnvMe(): void {
this.cmd.log('local: Checking for .env.me')
this.cmd.log('local: Checking for .env.me')
}

async _createEnvMe(): Promise<void> {
writeFileSync('.env.me', `DOTENV_ME=${this.generatedMeUid}`)
}

async _authEnvMe(): Promise<void> {
this.cmd.log('local: Generating .env.me credential')
this.cmd.log('local: Generating .env.me credential')
this._logProTip()

const email = await CliUx.ux.prompt('What is your email address?', {type: 'mask'})

this.cmd.log('remote: Securely sending a code')
this.cmd.log('remote: Securely sending a code')

const options: AxiosRequestConfig = {
method: 'POST',
Expand All @@ -156,7 +156,7 @@ class PullService {
// submit email for identification
try {
await axios(options)
this.cmd.log('remote: Sent. Check your email.')
this.cmd.log('remote: Sent. Check your email.')
this._createEnvMe()
this._promptForShortCode()
} catch (error) {
Expand All @@ -167,7 +167,7 @@ class PullService {
async _promptForShortCode(): Promise<void> {
const shortCode = await CliUx.ux.prompt('What is the code?')

this.cmd.log('remote: Verifying')
this.cmd.log('remote: Verifying')

const options: AxiosRequestConfig = {
method: 'POST',
Expand All @@ -182,15 +182,15 @@ class PullService {

try {
await axios(options)
this.cmd.log('remote: Verified successfully')
this.cmd.log('remote: Verified successfully')
this._pull()
} catch (error) {
this._logError(error)
}
}

async _pull(): Promise<void> {
this.cmd.log('remote:')
this.cmd.log('remote: ')

const options: AxiosRequestConfig = {
method: 'POST',
Expand All @@ -211,8 +211,8 @@ class PullService {

const outputFilename = this._smartFilename(envName)

this.cmd.log(`remote: Securely pulling ${environment} to ${outputFilename}`)
this.cmd.log('remote:')
this.cmd.log(`remote: Securely pulling ${environment} to ${outputFilename}`)
this.cmd.log('remote: ')

writeFileSync(outputFilename, newData)
this._logCompleted()
Expand Down Expand Up @@ -259,9 +259,9 @@ class PullService {
}

_logProTip(): void {
this.cmd.log('local:')
this.cmd.log('local: 💡ProTip! The .env.me file securely identifies your machine against this project in Dotenv Vault')
this.cmd.log('local:')
this.cmd.log('local: ')
this.cmd.log('local: 💡ProTip! The .env.me file securely identifies your machine against this project in Dotenv Vault')
this.cmd.log('local: ')
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/services/push-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class PushService {
}

_logCheckingForEnvProject(): void {
this.cmd.log('local: Checking for .env.project')
this.cmd.log('local: Checking for .env.project')
}

_logMissingEnvProject(): void {
Expand All @@ -173,8 +173,8 @@ class PushService {
}

_logCheckingForEnv(): void {
this.cmd.log('local:')
this.cmd.log(`local: Checking for ${this.smartFilename}`)
this.cmd.log('local: ')
this.cmd.log(`local: Checking for ${this.smartFilename}`)
}

_logMissingEnv(): void {
Expand All @@ -184,20 +184,20 @@ class PushService {
}

_logCheckingForEnvMe(): void {
this.cmd.log('local: Checking for .env.me')
this.cmd.log('local: Checking for .env.me')
}

async _createEnvMe(): Promise<void> {
writeFileSync('.env.me', `DOTENV_ME=${this.generatedMeUid}`)
}

async _authEnvMe(): Promise<void> {
this.cmd.log('local: Generating .env.me credential')
this.cmd.log('local: Generating .env.me credential')
this._logProTip()

const email = await CliUx.ux.prompt('What is your email address?', {type: 'mask'})

this.cmd.log('remote: Securely sending a code')
this.cmd.log('remote: Securely sending a code')

const options: AxiosRequestConfig = {
method: 'POST',
Expand All @@ -213,7 +213,7 @@ class PushService {
// submit email for identification
try {
await axios(options)
this.cmd.log('remote: Sent. Check your email.')
this.cmd.log('remote: Sent. Check your email.')
this._createEnvMe()
this._promptForShortCode()
} catch (error) {
Expand All @@ -224,7 +224,7 @@ class PushService {
async _promptForShortCode(): Promise<void> {
const shortCode = await CliUx.ux.prompt('What is the code?')

this.cmd.log('remote: Verifying')
this.cmd.log('remote: Verifying')

const options: AxiosRequestConfig = {
method: 'POST',
Expand All @@ -239,22 +239,22 @@ class PushService {

try {
await axios(options)
this.cmd.log('remote: Verified successfully')
this.cmd.log('remote: Verified successfully')
this._push()
} catch (error) {
this._logError(error)
}
}

async _push(): Promise<void> {
this.cmd.log('remote:')
this.cmd.log('remote: ')
if (this.smartEnvironment) {
this.cmd.log(`remote: Securely pushing ${this.smartFilename} to ${this.smartEnvironment}`)
this.cmd.log(`remote: Securely pushing ${this.smartFilename} to ${this.smartEnvironment}`)
} else {
this.cmd.log(`remote: Securely pushing ${this.smartFilename}`)
this.cmd.log(`remote: Securely pushing ${this.smartFilename}`)
}

this.cmd.log('remote:')
this.cmd.log('remote: ')

const options: AxiosRequestConfig = {
method: 'POST',
Expand Down Expand Up @@ -302,9 +302,9 @@ class PushService {
}

_logProTip(): void {
this.cmd.log('local:')
this.cmd.log('local: 💡ProTip! The .env.me file securely identifies your machine against this project in Dotenv Vault')
this.cmd.log('local:')
this.cmd.log('local: ')
this.cmd.log('local: 💡ProTip! The .env.me file securely identifies your machine against this project in Dotenv Vault')
this.cmd.log('local: ')
}
}

Expand Down