简体   繁体   English

每次我的OSX机器启动时,如何自动完成流浪?

[英]How can I automatically do vagrant up every time my OSX machine boots?

I need a way to automatically do a vagrant up command inside my directory /Users/user/Dropbox/Development/Homestead 我需要一种方法在我的目录/ Users / user / Dropbox / Development / Homestead中自动执行vagrant up命令

Does anyone know how this can be achieved? 有谁知道如何实现这一目标?

You can write an automator application (ie workflow) and in that application have it run the shell script with your desired vagrant command. 您可以编写一个automator应用程序(即工作流程),并在该应用程序中使用您所需的vagrant命令运行shell脚本。 Then go to System Preferences -> Accounts -> Login items and add that application as a login item. 然后转到系统偏好设置 - >帐户 - >登录项目,并将该应用程序添加为登录项目。

在此输入图像描述

With a LaunchD item. 使用LaunchD项目。 Put a file containing this in your /Library/LaunchDaemons directory: 将包含此文件的文件放在/ Library / LaunchDaemons目录中:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>UserName</key>
 <string>user</string>
 <key>Label</key>
 <string>org.xyzzy.vagrantsrc</string>
 <key>EnvironmentVariables</key>
   <dict>
     <key>PATH</key>
     <string>/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
   </dict>
 <key>ProgramArguments</key>
 <array>
    <string>/usr/bin/vagrant</string>
    <string>up</string>
 </array>
 <key>RunAtLoad</key><true/>
 <key>UserName</key><string>jenkins</string>
 <key>WorkingDirectory</key><string>/Users/user/Dropbox/Development/Homestead</string>
</dict>
</plist>

It needs to be owned by root and called something.plist 它需要由root拥有并调用something.plist

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在OSX中自动启动程序? - How can I make a program start up automatically in OSX? 如何在 Vagrant 下运行 OSX El Capitan Box? - How can I run an OSX El Capitan Box under Vagrant? gcloud 每小时在我的本地 (OSX) 开发人员机器上做什么 - What is gcloud doing every hour on my local (OSX) developer machine 我可以检测来宾是否正在使用OSX计算机? - Can I detect if a guest is using an OSX machine? 当我将它从OSX移动到Ubuntu机器时,为什么必须重新编译我的C程序? - Why do I have to recompile my C program when I move it from OSX to a Ubuntu machine? 如何在 OSX 上使用 IntelliJ IDEA 设置 Python 3? - How do I set up Python 3 with IntelliJ IDEA on OSX? 如何在OSx中正确设置Django项目? - How do I properly set up a django project in OSx? 如何将sphero ollie连接到Mac OSX? - How do I connect my sphero ollie to my Mac OSX? 如何在Linux Vagrant VM内设置桌面用户,使其表现为具有通常用户名,ssh键等的标准工具控制台? - How can I set up my desktop user inside a Linux Vagrant VM so that it behaves like a standard tools console with my usual username, ssh keys, etc.? 如何将我的OSX Cocoa应用程序与Facebook连接? - How do I connect my OSX Cocoa Application with facebook?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM