当前位置: 首页 > 编程日记 > 正文

firebase 发生消息_如何在命令行提示符下显示当前的Firebase项目名称,以防止发生危险错误...

firebase 发生消息

by Thang Minh Vu

Thang Minh Vu

如何在命令行提示符下显示当前的Firebase项目名称,以防止发生危险错误 (How to show your current Firebase project name on the command line prompt to prevent dangerous errors)

When working on a project with multiple stages (development, staging, production), developers use the command firebase use to switch between projects. It’s very easy to run a command on the production environment instead of the development. This is very dangerous.

在具有多个阶段(开发,阶段,生产)的项目上工作时,开发人员可以使用firebase use命令在项目之间进行切换。 在生产环境而不是开发环境上运行命令非常容易。 这是非常危险的。

Note: You can always find the latest script at my GitHub repository.

注意 :您总是可以在我的GitHub存储库中找到最新的脚本。

Normally, developers only work on the development project. They only switch to production in case of checking or doing a hotfix. There have been a few times when I forgot to switch back to the development project. I accidentally changed the database without thinking that it could impact the actual users.

通常,开发人员只从事开发项目。 他们仅在检查或进行修补程序的情况下才切换到生产环境。 有好几次我忘了切换回开发项目。 我无意间更改了数据库,却没有想到这可能会影响实际用户。

Digging into the firebase CLI, I found that it uses configstore to manage local configuration. All config is saved in a JSON file and reads easily. I created a small script which is intended to show the firebase project name on shell prompt.

深入研究Firebase CLI ,我发现它使用configstore来管理本地配置。 所有配置均保存在JSON文件中,易于阅读。 我创建了一个小脚本,旨在在shell提示符下显示firebase项目名称。

如何设定 (How to set it up)

重击 (Bash)

Add the following script to the end of ~/.bash_profile:

将以下脚本添加到~/.bash_profile的末尾:

Then run source ~/.bash_profile or open a new terminal window:

然后运行source ~/.bash_profile或打开一个新的终端窗口:

iTerm2与oh-my-zsh (iTerm2 with oh-my-zsh)

Oh-my-zsh is a popular open source framework for Zshell. I like it because it has many beautiful terminal themes and many useful plugins.

Oh-my-zsh是Zshell的流行开源框架。 我喜欢它,因为它有许多漂亮的终端主题和许多有用的插件。

Here, I will make an example with the agnoster theme:Edit ~/.oh-my-zsh/themes/agnoster.zsh-theme

在这里,我将以agnoster主题为例:编辑~/.oh-my-zsh/themes/agnoster.zsh-theme

and then add prompt_firebase to build_prompt functions:

然后将prompt_firebase添加到build_prompt函数:

For the final step, run source ~/.zshrc or open a new terminal window:

对于最后一步,运行source ~/.zshrc或打开一个新的终端窗口:

I hope this can help you prevent the an unexpected (and bad) situation.

我希望这可以帮助您防止出现意外(严重)情况。

Note: You can always find the latest script at my GitHub repository.

注意 :您总是可以在我的GitHub存储库中找到最新的脚本。

翻译自: https://www.freecodecamp.org/news/how-to-show-your-current-firebase-project-name-on-the-command-line-prompt-to-prevent-dangerous-1bfee6293811/

firebase 发生消息

相关文章:

使用SQLite删除Mac OS X 中launchpad里的快捷方式

一般情况下,从App Store安装的应用程序,如果应用删除,那么launchpad里对应的图标会一起删除了。 而对于不是通过App Store安装的应用程序,删除应用程序,Launchpad中很可能仍然留有相关程序图标。不能忍!是要…

php传递JSON数据

QQ技术交流群 173683866 526474645 欢迎加入交流讨论,打广告的一律飞机票 php代码 public function ttt(){$data request()->param();$refund_fee $data[total_fee];$refund_phone $data[refund_phone];// consignee-金额;number-电话号码&a…

中国制造2025+互联网+,引领制造业发展

"中国制造2025""互联网",引领制造业发展转载于:https://www.cnblogs.com/DTWolf/p/4733568.html

swift通知栏推送_如何使用Swift和Laravel使用推送通知创建iOS加密跟踪应用

swift通知栏推送by Neo Ighodaro由新Ighodaro 如何使用Swift和Laravel使用推送通知创建iOS加密跟踪应用 (How to create an iOS crypto tracking app with push notifications using Swift and Laravel) 第2部分 (Part 2) You will need the following installed on your mach…

【转】MySQL常用命令总结

http://blog.csdn.net/qq_33850438/article/details/52144686 MySQL常用的基本操作,以下都是MySQL 5.0下测试通过首先说明下,记住在每个命令结束时加上;(分号) 1. 导出整个数据库 mysqldump -u 用户名 -p --default-ch…

JS中window.document对象

小知识点注:外面双引号,里面的双引号改为单引号; 在div里面行高设置和整个外面高度一样,才能用竖直居中,居中是行居中 文本框取出来的值是字符串,需要用parseint()转化为数字 Window.document对象 一、找到…

php 常用方法

QQ技术交流群 173683866 526474645 欢迎加入交流讨论,打广告的一律飞机票 字符串分割成数组 explode() $str_formId aa,bb,cc;$arr_formId explode(,, $str_formId); 删除数组的第一个下标 array_shift() $str_formId aa,bb,cc;$arr_formId explode(,, $str_f…

stackoverflow_StackOverflow帐户如何确保您在公认的开发人员表格中占有一席之地

stackoverflowby Melchor Tatlonghari由Melchor Tatlonghari StackOverflow帐户如何确保您在公认的开发人员表格中占有一席之地 (How a StackOverflow account can secure you a seat at the recognised developer table) I have never met a developer who hasn’t heard of …

Python文件打包成exe

1. 安装pyinstaller pip install pyinstaller 2.如果有外部依赖包 将外部依赖包放到你的python安装的site-packages D:\Python27\Lib\site-packages 3.直接在命令提示符中输入pyinstaller -F 文件名.py 注意F要大写 4. exe在dist文件夹里面,如果你还用到了外部的文件…

小程序群发模板消息

QQ技术交流群 173683866 526474645 欢迎加入交流讨论,打广告的一律飞机票 场景: 微信小程序一键群发模板消息(针对所有使用过小程序的用户),发送消息提醒用户,进入指定页面。 实现步骤: 利用…

bat启动/停止oracle服务

自己的电脑比较慢,尤其装了oracle10g后,服务开启和关闭用bat文件操作省事点 开启服务 echo offnet start OracleServiceORCLnet start OracleDBConsoleorclnet start OracleOraDb11g_home1TNSListenernet start OracleOraDb11g_home1iSQL*Plus pause 停止…

docker使用mongo_如何使用Docker在AWS上部署Mongo:初学者的权威指南

docker使用mongo为什么需要这个? (Why you need this?) 因为JS Python Mongo 完整的数据开发 (Because JS Python Mongo full data development) I am a Meteor developer. More precisely I use Vulcan.js, but that’s a whole other story. Meteor is a fu…

git命令每次都要输入账号密码解决方法

QQ技术交流群 173683866 526474645 欢迎加入交流讨论,打广告的一律飞机票 1. 打开项目cmd , 打开方式 - 进入项目的文件目录,在目录中输入 cmd 2.在命令行输入命令 git config --global credential.helper store 3.在命令行输入命令 git pull 意思是创建一…

Linux C中strcpy , strncpy , strlcpy 的区别

strcpy ,strncpy ,strlcpy的用法 好多人已经知道利用strncpy替代strcpy来防止缓冲区越界。 但是如果还要考虑运行效率的话,也许strlcpy是一个更好的方式。 1. strcpy strcpy 是依据 /0 作为结束判断的,如果 to 的空间不够,则会引起 buffer ov…

入职后发现公司是外包全职_我如何通过全职工作,伴侣和3岁的双胞胎男孩打造产品...

入职后发现公司是外包全职by Courtney通过考特尼 我如何通过全职工作,伴侣和3岁的双胞胎男孩打造产品 (How I built my product with a full-time job, partner and 3 year old twin boys) If you’ve opened this article then I’ll assume that you’re either …

Java NIO中的Buffer

简介 Buffer缓冲区,首先要弄明白的是,缓冲区是怎样一个概念。它其实是缓存的一种,我们常说的缓存,包括保存在硬盘上的浏览器缓存,保存在内存中的缓存(比如Redis、memcached)。Buffer是把数据保存在内存中&a…

编写高质量代码改善C#程序的157个建议——建议86:Parallel中的异常处理

建议86:Parallel中的异常处理建议85阐述了如何处理Task中的异常。由于Task的Start方法是异步启动的,所以我们需要额外的技术来完成异常处理。Parallel相对来说就要简单很多,因为Parallel的调用者线程会等到所有的任务全部完成后,再…

VS Code – No source control providers 解决方法

QQ技术交流群 173683866 526474645 欢迎加入交流讨论,打广告的一律飞机票 1.点击IDE左侧的搜索 2.在搜索中输入 git.enabled 3.点击Open Serrings 4.在Settings中的搜索框输入 git.enabled 5.把它下方的三个选项User Workpace broadband-h5(项目名称) 的Git en…

如何从JavaScript中的给定数字中形成最小的数字

by Prashant Yadav通过Prashant Yadav 如何从JavaScript中的给定数字中形成最小的数字 (How to form the smallest possible number from a given number in JavaScript) In this tutorial, we will implement an algorithm to form the smallest possible number with ES6.在…

微信小程序在web-view页面做分享,并且把分享的参数传递给小程序

QQ技术交流群 173683866 526474645 欢迎加入交流讨论&#xff0c;打广告的一律飞机票 本demo实现的功能&#xff0c;微信小程序给h5传参&#xff0c;h5给小程序传参 实现代码&#xff1a; <!--index.wxml --><web-view src"https://xxx.xxx.cn/test1.html?us…

洛谷—— P1118 [USACO06FEB]数字三角形Backward Digit Su…

https://www.luogu.org/problem/show?pid1118#sub 题目描述 FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 < N < 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer number. T…

Centos和Redhat的区别和联系

网上看到的&#xff0c;转载给大家 CentOS与RedHat的关系&#xff1a; RedHat在发行的时候&#xff0c;有两种方式&#xff1a;二进制的发行方式以及源代码的发行方式。无论是哪一种发行方式&#xff0c;你都可以免费获得&#xff08;例如从网上下载&#xff09;&#xff0c;并…

矩阵专职_新的篇章开始了-我将以专职技术作家的身份加入RunCloud

矩阵专职If you used to submit (or read) articles on the freeCodeCamp Medium publication, there is a chance that your article may have been edited by me (or by another member of the team of volunteer editors).如果您以前曾经在freeCodeCamp Medium出版物上提交(…

转:【小作品】STM32无线WIFI视频小车制作剖析(下)

转载于&#xff1a;http://blog.csdn.net/u012819339/article/details/50654764 实体作品请参看优酷视频。 若以上链接点击无效请把该链接地址复制到浏览器地址栏 http://v.youku.com/v_show/id_XODYzODczNzQ4.html 说明&#xff1a; 该作品为arvik于2014年下半年在学校实验室做…

JS 缓存 设置临时缓存和长期缓存 sessionStorage localStorage

QQ技术交流群 173683866 526474645 欢迎加入交流讨论&#xff0c;打广告的一律飞机票 使用 Window sessionStorage 和 localStorage 属性 sessionStorage 用于临时保存同一窗口(或标签页)的数据&#xff0c;在关闭窗口或标签页之后将会删除这些数据 localStorage 缓存在浏览…

SQL中distinct的用法

在表中&#xff0c;可能会包含重复值。这并不成问题&#xff0c;不过&#xff0c;有时您也许希望仅仅列出不同&#xff08;distinct&#xff09;的值。关键词 distinct用于返回唯一不同的值。表A&#xff1a;示例1select distinct name from A 执行后结果如下&#xff1a;示例2…

brain.js 时间序列_免费的Brain JS课程学习JavaScript中的神经网络

brain.js 时间序列The last few years, machine learning has gone from a promising technology to something we’re surrounded with on a daily basis. And at the heart of many machine learning systems lies neural networks.在过去的几年中&#xff0c;机器学习已经从…

小白的Unity5之路(一)

Player移动: 1 public float speed 6f;2 Vector3 movement;3 Rigidbody playerRididbody;4 5 void FixedUpdate () {6 float h Input.GetAxisRaw("Horizontal");7 float v Input.GetAxisRaw("Vertical");8 Move(h, v); 9…

Splunk学习与实践

一、 Splunk公司与产品 美国Splunk公司&#xff0c;成立于2004年&#xff0c;2012年纳斯达克上市&#xff0c;第一家大数据上市公司&#xff0c;荣获众多奖项和殊荣。总部位于美国旧金山&#xff0c;伦敦为国际总部&#xff0c;香港设有亚太支持中心&#xff0c;上海设有海外第…

VUE v-if 和 v-for 的使用示例 VUE根据下标改变图片路径

QQ技术交流群 173683866 526474645 欢迎加入交流讨论&#xff0c;打广告的一律飞机票 v-if 和 v-else v-for <div class"" v-for"(item,index) in [1,1,1,1,1,1,1,1,1,1]"><img v-if"helpeds0" class"tou1" :style"{…