<div dir="ltr">Hi,<div><br></div><div>There is no native method in swift to get the environment list right now but you can use Foundation&#39;s NSProcessInfo</div><div>If you want an example: <a href="https://github.com/apple/swift-package-manager/blob/master/Sources/Commands/SwiftTestTool.swift#L188">https://github.com/apple/swift-package-manager/blob/master/Sources/Commands/SwiftTestTool.swift#L188</a></div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 10, 2016 at 2:49 PM, Yannick Heinrich via swift-build-dev <span dir="ltr">&lt;<a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="font-size:12.8px">Hello,</p><p style="font-size:12.8px"><span style="font-size:12.8px">I initiated the PR #400 in the package manager and I’m trying to implement the last suggestion in this thread. </span><br></p><p style="font-size:12.8px">This is to recopy the current environment variables for git clone instead of cherry-pick several specifics one.</p><p style="font-size:12.8px"><span style="font-size:12.8px">I would like to use the _NSGetEnviron variable that should be defined in Darwin but I don’t manage to reference it.</span><br></p><p style="font-size:12.8px"><span style="font-size:12.8px">I tried:</span><br></p><p style="font-size:12.8px">return environ</p><p style="font-size:12.8px">return Darwin.environ</p><p style="font-size:12.8px">return libc.environ</p><p style="font-size:12.8px"><span style="font-size:12.8px"><br></span></p><p style="font-size:12.8px"><span style="font-size:12.8px">I’m using the DEVELOPMENT-SNAPSHOT-2016-05-</span><span style="font-size:12.8px">09-a toolchain.</span><br></p><p style="font-size:12.8px"><span style="font-size:12.8px">Any tips on how to call this method from Swift ?</span><br></p><p style="font-size:12.8px"><span style="font-size:12.8px">Regards</span><span class="HOEnZb"><font color="#888888"><br></font></span></p><span class="HOEnZb"><font color="#888888"><p style="font-size:12.8px"><span style="font-size:12.8px">Yannick</span></p><div style="margin:2px 0px 0px;font-size:12.8px"></div></font></span></div>
<br>_______________________________________________<br>
swift-build-dev mailing list<br>
<a href="mailto:swift-build-dev@swift.org">swift-build-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ankit<br><br></div>
</div>